Data is given as CSV file. First two column are deleted.
mask1 <- read.csv ("C:/Users/MEHMET/Desktop/IE 582/Musk1 Dosyasının Kopyası.csv",header=FALSE, sep = ",")
mask1.active <- mask1[,3:168]
the variable standard deviations (the scaling is applied to each variable)
res.pca <- prcomp (mask1.active, scale = TRUE)
names(res.pca)
## [1] "sdev" "rotation" "center" "scale" "x"
sdev : the standard deviations of the principal components (the square roots of the eigenvalues)
rotation : the matrix of variable loadings (columns are eigenvectors)
Eigenvalues
Variances in percentage
Cumulative variances
head(res.pca$sdev)
## [1] 7.195296 4.807327 3.556111 2.921889 2.857735 2.601871
head(unclass(res.pca$rotation)[, 1:10])
## PC1 PC2 PC3 PC4 PC5
## V3 -0.0368698531 0.0036570678 0.101966679 -0.06953966 0.0373835724
## V4 -0.0683111424 -0.0187516841 0.170635673 0.11413651 -0.0508386602
## V5 -0.0948053725 0.0016863889 0.142775041 0.06199205 -0.1176633400
## V6 0.0925859839 -0.0001258461 -0.013430257 0.12588400 0.0005978495
## V7 -0.0009004731 -0.0023138712 0.008306548 -0.03565104 0.0152789269
## V8 -0.0609551501 0.0034399442 -0.038287645 0.04078182 0.0175225314
## PC6 PC7 PC8 PC9 PC10
## V3 -0.037143720 0.16623414 -0.07408505 0.0318768712 -0.040546695
## V4 -0.014432198 -0.02277787 0.07358716 -0.0441729036 -0.071960330
## V5 -0.000184402 -0.05001262 0.07641516 -0.0216409021 -0.023947992
## V6 0.119116241 0.05729913 -0.01328586 0.0016978279 -0.189471983
## V7 -0.041046049 0.10712853 -0.05584153 0.0009369786 0.007787736
## V8 0.269271911 0.09787766 0.04891433 0.0531169943 -0.027194632
eig <- (res.pca$sdev)^2
variance <- eig*100/sum(eig)
cumvar <- cumsum(variance)
eig.mask1.active <- data.frame(eig = eig, variance = variance, cumvariance = cumvar)
eig.mask1.active[1:20,]
## eig variance cumvariance
## 1 51.772288 31.1881251 31.18813
## 2 23.110393 13.9219234 45.11005
## 3 12.645923 7.6180258 52.72807
## 4 8.537433 5.1430318 57.87111
## 5 8.166648 4.9196675 62.79077
## 6 6.769733 4.0781523 66.86893
## 7 5.388912 3.2463325 70.11526
## 8 5.050768 3.0426312 73.15789
## 9 3.306281 1.9917355 75.14963
## 10 2.850453 1.7171402 76.86677
## 11 2.571411 1.5490428 78.41581
## 12 2.376745 1.4317743 79.84758
## 13 2.207486 1.3298111 81.17739
## 14 2.108723 1.2703148 82.44771
## 15 1.812977 1.0921547 83.53986
## 16 1.657314 0.9983817 84.53824
## 17 1.437282 0.8658327 85.40408
## 18 1.355483 0.8165560 86.22063
## 19 1.256147 0.7567152 86.97735
## 20 1.185238 0.7139986 87.69135
print("13 out of 166 dimensions contain %80 of the variance")
## [1] "13 out of 166 dimensions contain %80 of the variance"
Screen plot using base graphics Add connected line segments to the plot
barplot (eig.mask1.active [, 2], names.arg=1:nrow(eig.mask1.active), main = "Variances",xlab = "Principal Components",ylab = "Percentage of variances",
col ="steelblue")
lines (x = 1:nrow(eig.mask1.active), eig.mask1.active [, 2],type="b", pch=19, col = "red")
OR the same above with summary () function use the function summary() to extract the eigenvalues and variances from an object of class prcomp summary(res.pca)
ind.coord <- res.pca$x
head(ind.coord[, 1:13])
## PC1 PC2 PC3 PC4 PC5 PC6
## [1,] -0.7870220 -8.655373 -2.43062015 -8.100733 0.1408377 2.4027466
## [2,] -0.7816826 -8.535124 -2.63326679 -7.007034 1.0943637 1.0022780
## [3,] -0.2478201 -8.351507 -2.45185223 -8.097990 0.8303654 1.7224025
## [4,] -1.3549969 -9.096528 -2.63635288 -7.035515 0.4576381 1.6579415
## [5,] -1.4575178 -8.675879 0.01666451 -7.992784 2.8270748 1.5744610
## [6,] -1.4311819 -8.514454 -0.18698801 -6.926909 3.8490586 0.1900508
## PC7 PC8 PC9 PC10 PC11 PC12
## [1,] -3.2668751 2.0698017 -1.2966531 0.18981509 0.9187314 0.1908860
## [2,] -1.9284613 3.7264700 2.0511993 0.23166496 -0.8251574 -0.8155672
## [3,] -2.3463715 2.7166908 0.2127552 -1.34376498 -1.9891208 -0.8432403
## [4,] -2.8112963 3.1577394 0.6020808 1.73326340 2.0006204 0.1807289
## [5,] -0.3365758 0.4036279 -1.7690861 -0.08671512 1.1679582 -0.3711877
## [6,] 1.0235737 2.0373243 1.5174426 -0.07555743 -0.5929691 -1.3338966
## PC13
## [1,] -0.4398840
## [2,] -0.9262646
## [3,] 0.2025423
## [4,] -1.6270701
## [5,] -0.2937771
## [6,] -0.7169987
#To calculate the cos2 of individuals, 2 simple steps are required :
# Calculate the square distance between each individual and the PCA center of gravity
# d2 = [(var1_ind_i - mean_var1)/sd_var1]^2 + …+ [(var10_ind_i - mean_var10)/sd_var10]^2 + …+..
# Calculate the cos2 = ind.coord^2/d2
# Compute the square of the distance between an individual and the
# center of gravity
center <- res.pca$center
scale<- res.pca$scale
getdistance <- function(ind_row, center, scale){
return(sum(((ind_row-center)/scale)^2))
}
d2 <- apply(mask1.active,1,getdistance, center, scale)
# Compute the cos2
cos2 <- function(ind.coord, d2){return(ind.coord^2/d2)}
ind.cos2 <- apply(ind.coord, 2, cos2, d2)
head(ind.cos2[, 1:13])
## PC1 PC2 PC3 PC4 PC5
## [1,] 0.0032287931 0.3905154 3.079645e-02 0.3420701 0.0001033962
## [2,] 0.0033016069 0.3936264 3.746745e-02 0.2652973 0.0064712452
## [3,] 0.0003380671 0.3839368 3.309166e-02 0.3609811 0.0037954955
## [4,] 0.0092875230 0.4185763 3.515850e-02 0.2503889 0.0010594186
## [5,] 0.0116353975 0.4122687 1.521034e-06 0.3499046 0.0437751944
## [6,] 0.0116616132 0.4127457 1.990657e-04 0.2731794 0.0843486184
## PC6 PC7 PC8 PC9 PC10
## [1,] 0.0300941745 0.0556328819 0.0223318127 0.0087642368 1.878140e-04
## [2,] 0.0054280125 0.0200949220 0.0750342826 0.0227342272 2.899914e-04
## [3,] 0.0163304910 0.0303056431 0.0406265912 0.0002491669 9.939776e-03
## [4,] 0.0139047028 0.0399794242 0.0504400915 0.0018337194 1.519681e-02
## [5,] 0.0135774214 0.0006204677 0.0008923101 0.0171416016 4.118538e-05
## [6,] 0.0002056403 0.0059649551 0.0236313887 0.0131097212 3.250299e-05
## PC11 PC12 PC13
## [1,] 0.004399908 0.0001899393 0.0010086553
## [2,] 0.003679070 0.0035940492 0.0046359058
## [3,] 0.021779719 0.0039141064 0.0002258196
## [4,] 0.020246626 0.0001652261 0.0133917031
## [5,] 0.007471504 0.0007546415 0.0004727042
## [6,] 0.002001857 0.0101300889 0.0029268851
#The contribution of individuals (in percentage) to the principal components can be computed as follow :
#100 * (1 / number_of_individuals)*(ind.coord^2 / comp_sdev^2)
# Contributions of individuals
contrib <- function(ind.coord, comp.sdev, n.ind){
100*(1/n.ind)*ind.coord^2/comp.sdev^2
}
ind.contrib <- t(apply(ind.coord,1, contrib,res.pca$sdev, nrow(ind.coord)))
head(ind.contrib[, 1:13])
## PC1 PC2 PC3 PC4 PC5 PC6
## [1,] 0.0025134452 0.6810160 9.814693e-02 1.614784 0.0005102551 0.179158517
## [2,] 0.0024794570 0.6622248 1.151946e-01 1.208187 0.0308086446 0.031174384
## [3,] 0.0002492118 0.6340382 9.986909e-02 1.613690 0.0177373083 0.092064203
## [4,] 0.0074502749 0.7522064 1.154648e-01 1.218029 0.0053875773 0.085302142
## [5,] 0.0086203211 0.6842466 4.613472e-06 1.572034 0.2056003328 0.076928159
## [6,] 0.0083116144 0.6590212 5.808581e-04 1.180714 0.3811169308 0.001120884
## PC7 PC8 PC9 PC10 PC11
## [1,] 0.41606101 0.178194017 0.106831886 0.0026554655 0.06896022
## [2,] 0.14498191 0.577604949 0.267343122 0.0039554866 0.05562821
## [3,] 0.21462756 0.306984223 0.002876165 0.1330839979 0.32325395
## [4,] 0.30810958 0.414751735 0.023033656 0.2214156607 0.32700237
## [5,] 0.00441629 0.006776384 0.198861730 0.0005542029 0.11144898
## [6,] 0.04084418 0.172645772 0.146311279 0.0004207591 0.02872669
## PC12 PC13
## [1,] 0.003220762 0.018414981
## [2,] 0.058793585 0.081651682
## [3,] 0.062851125 0.003904152
## [4,] 0.002887126 0.251946031
## [5,] 0.012178606 0.008213551
## [6,] 0.157273199 0.048925102
# Note that the sum of all the contributions per column is 100
ind.coord <- cbind(ind.coord, mask1$V1)
colnames(ind.coord)[colnames(ind.coord)==""] <- "V1"
plot(ind.coord[,1], ind.coord[,2], col = ind.coord[,167]+ 1 , pch = 19,xlab="PC1 – 31.18%",ylab="PC2 – 13.92%")
legend("bottomright",cex = 0.55, legend = c("1", "0"), fill = 1:2)
abline(h=0, v=0, lty = 2)
text(ind.coord[,1], ind.coord[,2], labels=rownames(ind.coord),cex=0.7, pos = 3)
Data is given as CSV file. First two column are deleted.
# EXTRACT FİRST TO COLUMNS
mask2.active <- mask1 [,3:168]
#head (mask2.active)
euclidean distances between the rows with scaling
distance_part_1a <- dist(scale(mask2.active))
distance_part_1a <-data.matrix(distance_part_1a)
fit <- cmdscale(distance_part_1a,eig=TRUE, k=166)
k is the number of dim fit view results plot solution
x <- fit$points[,1]
y <- fit$points[,2]
plot(x, y, xlab="Coordinate 1", ylab="Coordinate 2",col= mask1[,1]+1, main="Metric MDS")
abline(h=0, v=0, lty = 2)
#text(x, y, labels = row.names(mask2.active), col=mask1[,1]+1, cex=.7)
Mathematically and conceptually, there are close correspondences between MDS and other methods used to reduce the dimensionality of complex data, such as Principal components analysis (PCA) and factor analysis. PCA is more focused on the dimensions themselves, and seek to maximize explained variance, whereas MDS is more focused on relations among the #scaled objects. MDS projects n-dimensional data points to a (commonly) 2-dimensional space such that similar objects in the n-dimensional space will be
It is expected that BAG classes 0 and 1 (in graph black reds) has to be seperated in in different areas of the graphs. But in the graphs, this is not observed The explation is : the graphs are two dimensional these two dimensions do not cover 80 % of the variance (or similarities)
to take the average of multiple rows
mask1.average <- aggregate(mask1[, -c(1:2)], by = list(mask1$V1,mask1$V2),mean, na.rm = TRUE)
res.pca_1b <- prcomp (mask1.average, scale = TRUE)
names(res.pca_1b)
## [1] "sdev" "rotation" "center" "scale" "x"
head(res.pca_1b$sdev)
## [1] 6.660941 5.626150 4.751073 4.207714 3.101553 2.760043
head(unclass(res.pca_1b$rotation)[, 1:10])
## PC1 PC2 PC3 PC4 PC5
## Group.1 0.04463122 -0.003076793 0.11113592 0.019872124 0.02056881
## Group.2 -0.02413009 -0.011928212 -0.11958828 -0.014906750 -0.01862627
## V3 -0.05321657 -0.012972472 0.02478796 0.073524141 0.06964920
## V4 -0.06553578 0.011768063 -0.06736197 0.184556038 -0.02752374
## V5 -0.06083946 0.001440391 -0.05051918 0.187736017 -0.05825904
## V6 0.08390726 0.049635022 -0.09584341 -0.009168136 -0.17672207
## PC6 PC7 PC8 PC9 PC10
## Group.1 0.06914295 0.06538766 0.15233372 0.06730400 -0.093554000
## Group.2 -0.04831986 -0.10181044 -0.15128833 -0.14453079 0.076071158
## V3 -0.08866391 -0.05048083 0.17430128 -0.00711550 0.208376377
## V4 0.04187090 -0.05216477 0.02232890 0.00931202 -0.015632790
## V5 0.10236701 -0.00873377 0.01885503 -0.04989228 -0.006073795
## V6 -0.04027436 -0.03488311 0.09690788 -0.02224686 0.044453511
Eigenvalues
Variances in percentage
Cumulative variances
eig_1b <- (res.pca_1b$sdev)^2
variance_1b <- eig_1b*100/sum(eig)
cumvar_1b <- cumsum(variance_1b)
eig.mask1.average <- data.frame(eig_1b = eig_1b, variance_1b = variance_1b, cumvariance_1b = cumvar_1b)
head(eig.mask1.average)
## eig_1b variance_1b cumvariance_1b
## 1 44.368129 26.72779 26.72779
## 2 31.653567 19.06841 45.79620
## 3 22.572693 13.59801 59.39421
## 4 17.704854 10.66557 70.05979
## 5 9.619633 5.79496 75.85474
## 6 7.617840 4.58906 80.44380
OR the same above with summary () function
summary(res.pca_1b)
barplot(eig.mask1.average [, 2], names.arg=1:nrow(eig.mask1.average),
main = "Variances",
xlab = "Principal Components",
ylab = "Percentage of variances",
col ="steelblue")
# Add connected line segments to the plot
lines (x = 1:nrow(eig.mask1.average),eig.mask1.average [, 2],type="b", pch=19, col = "red")
print("6 out of 166 dimensions contain %80 of the variance ")
## [1] "6 out of 166 dimensions contain %80 of the variance "
ind.coord_1b <- res.pca_1b$x
head(ind.coord_1b[, 1:6])
## PC1 PC2 PC3 PC4 PC5 PC6
## [1,] -1.419314 7.394696 9.563691 -3.5113875 -0.01786291 4.08463393
## [2,] -3.361438 6.796293 9.943455 -1.9836347 1.39503368 0.08618399
## [3,] -4.243942 8.410518 7.984341 -0.1969055 0.03572679 -1.05800465
## [4,] -3.238588 8.823437 7.869699 -1.3828248 -1.23653361 4.81568481
## [5,] -5.108463 8.266105 7.620072 1.8165003 0.22273292 -5.07839888
## [6,] -5.856240 8.285880 6.978276 -1.1532488 2.05005540 -1.17789410
Compute the square of the distance between an individual and the center of gravity
center_1b <- res.pca_1b$center
scale_1b <- res.pca_1b$scale
getdistance_1b <- function(ind_row_1b, center_1b, scale_1b){
return(sum(((ind_row_1b-center_1b)/scale_1b)^2))
}
d2_1b <- apply(mask1.average,1,getdistance_1b, center_1b, scale_1b)
cos2_1b <- function(ind.coord_1b, d2){return(ind.coord_1b^2/d2_1b)}
ind.cos2_1b <- apply(ind.coord_1b, 2, cos2_1b, d2_1b)
head(ind.cos2_1b[, 1:6])
## PC1 PC2 PC3 PC4 PC5 PC6
## [1,] 0.01043073 0.2831379 0.4735965 0.0638432403 1.652197e-06 8.639004e-02
## [2,] 0.06242652 0.2551896 0.5462525 0.0217391337 1.075197e-02 4.103666e-05
## [3,] 0.10142213 0.3983266 0.3589814 0.0002183281 7.187567e-06 6.303315e-03
## [4,] 0.05605824 0.4161057 0.3310125 0.0102202708 8.172217e-03 1.239493e-01
## [5,] 0.11077036 0.2900313 0.2464684 0.0140059977 2.105775e-04 1.094704e-01
## [6,] 0.18485244 0.3700537 0.2624725 0.0071685862 2.265263e-02 7.478250e-03
Contributions of individuals
contrib_1b <- function(ind.coord_1b, comp.sdev_1b, n.ind_1b){
100*(1/n.ind_1b)*ind.coord_1b^2/comp.sdev_1b^2
}
ind.contrib_1b <- t(apply(ind.coord_1b,1, contrib_1b, res.pca_1b$sdev, nrow(ind.coord_1b)))
head(ind.contrib_1b[, 1:6])
## PC1 PC2 PC3 PC4 PC5 PC6
## [1,] 0.04935125 1.877717 4.404330 0.756967670 3.605439e-05 2.380601021
## [2,] 0.27681609 1.586111 4.761057 0.241570123 2.198989e-01 0.001059823
## [3,] 0.44124514 2.429042 3.069778 0.002380322 1.442254e-04 0.159718597
## [4,] 0.25695227 2.673407 2.982257 0.117396231 1.727689e-01 3.308997535
## [5,] 0.63932473 2.346342 2.796063 0.202577292 5.605605e-03 3.679882521
## [6,] 0.84019245 2.357582 2.344904 0.081651815 4.748811e-01 0.197967012
ind.coord_1b <- cbind(ind.coord_1b, mask1.average$Group.1)
colnames(ind.coord_1b)[colnames(ind.coord_1b)==""] <- "Group.1"
plot(ind.coord_1b[,1], ind.coord_1b[,2], col = ind.coord_1b[,93]+1 , pch = 19,
xlab="PC1 – 26.41%",ylab="PC2 – 18.84%")
legend("bottomright",cex = 0.55, legend = c("1", "0"), fill = 1:2)
abline(h=0, v=0, lty = 2)
text(ind.coord_1b[,1], ind.coord_1b[,2], labels=rownames(ind.coord_1b),
cex=0.7, pos = 3)
EXTRACT FIRST TO COLUMNS
mask1.average_1b <- aggregate(mask1[, -c(1:2)], by = list(mask1$V1,mask1$V2),mean, na.rm = TRUE)
distance_part_1b <- dist(scale(mask1.average_1b))
distance_part_1b <-data.matrix(distance_part_1b)
fit_1b <- cmdscale(distance_part_1b,eig=TRUE, k=91)
k is the number of dim fit view results plot solution
x <- fit_1b$points[,1]
y <- fit_1b$points[,2]
plot(x, y, xlab="Coordinate 1", ylab="Coordinate 2", col= mask1.average_1b[,1]+1, main="Metric MDS Average")
abline(h=0, v=0, lty = 2)
# text(x, y, labels = row.names(mask1.average_1b), col= mask1.average_1b[,1]+1, cex=.7)
Mathematically and conceptually, there are close correspondences between MDS and other methods used to reduce the dimensionality of complex data, such as Principal components analysis (PCA) and factor analysis. PCA is more focused on the dimensions themselves, and seek to maximize explained variance, whereas MDS is more focused on relations among the #scaled objects. MDS projects n-dimensional data points to a (commonly) 2-dimensional space such that similar objects in the n-dimensional space will be
It is expected that BAG classes 0 and 1 (in graph black reds) has to be seperated in in different areas of the graphs. But in the graphs, this is not observed The explation is : the graphs are two dimensional these two dimensions do not cover 80 % of the variance (or similarities)
Kernel method could be an alternative distance measurement for dissimilarity. Probablity it will overcome the problems in part a and b
A Turkish Airlines plane picture is selected.
Load the neccassery libraries.
library(imager)
## Loading required package: magrittr
##
## Attaching package: 'imager'
## The following object is masked from 'package:magrittr':
##
## add
## The following objects are masked from 'package:stats':
##
## convolve, spectrum
## The following object is masked from 'package:graphics':
##
## frame
## The following object is masked from 'package:base':
##
## save.image
require(jpeg)
## Loading required package: jpeg
require(imager)
require(data.table)
## Loading required package: data.table
The picture is resized to 256 x 256 using Microsoft Paint
image_plane <-load.image("C:/Users/MEHMET/Desktop/THY_7773ER_lowres_256.jpg")
str(image_plane)
## 'cimg' num [1:256, 1:256, 1, 1:3] 0.953 0.945 0.957 0.933 0.922 ...
plot(image_plane)
dim(image_plane)
## [1] 256 256 1 3
#display(image_plane)
class(image_plane)
## [1] "cimg" "imager_array" "numeric"
typeof(image_plane)
## [1] "double"
range(image_plane)
## [1] 0 1
hist(image_plane)
print(image_plane)
## Image. Width: 256 pix Height: 256 pix Depth: 1 Colour channels: 3
Let’s display the image. RasterImage function is usede.
par(mfrow = c(1,1))
x <- 1:256
y <- 1:256
plot(x,y, ann = FALSE, axes = FALSE, col = 0)
rasterImage(image_plane, 0,0,256,256)
# TASK 2-1 EXTRA display each channel separately using ‘’image‘’ function on a single plot
display each channel seperately 3 matrices are created seperately for each channel
red <- t(apply(image_plane[,,1],2,rev))
green <- t(apply(image_plane[,,2],2,rev))
blue <- t(apply(image_plane[,,3],2,rev))
Color palettes are created as follows.
red_palette <- colorRampPalette(c("black","red"))
blue_palette <- colorRampPalette(c("black","blue"))
green_palette <- colorRampPalette(c("black","green"))
Then, it is displayed below.
par(mfrow = c(1,3))
image(red, col = red_palette(256), ann = TRUE, axes = FALSE, main = "RED Channel" )
image(green, col = green_palette(256), ann = TRUE, axes = FALSE, main = "GREEN Channel")
image(blue, col = blue_palette(256), ann = TRUE, axes = FALSE, main = "BLUE Channel" )
Noise is added to the picture. First, n oise is added each of the channels. Then, They are normalized, and at finally the noisy image is displayed side-by-side with the original image.
noise_red <- matrix(runif(65536, min = 0, max = 2.56),256)
noise_green <- matrix(runif(65536, min = 0, max = 2.56),256)
noise_blue <- matrix(runif(65536, min = 0, max = 2.56),256)
image_plane_noise <- image_plane
image_plane_noise[,,1] <- image_plane[,,1] + noise_red
image_plane_noise [,,2] <- image_plane [,,2] + noise_green
image_plane_noise [,,3] <- image_plane [,,3] + noise_blue
image_plane_noise_red<- t(apply(image_plane_noise[,,1],2,rev))
image_plane_noise_green <- t(apply(image_plane_noise[,,2],2,rev))
image_plane_noise_blue <- t(apply(image_plane_noise[,,3],2,rev))
par(mfrow = c(1,2))
plot(x,y, axes = FALSE, col = 0, xlab = "",ylab = "", main = "image_plane_noise")
rasterImage(image_plane_noise, 0,0,256,256)
plot(x,y, axes = FALSE ,xlab = "",ylab = "", col = 0, main = "image_plane ")
rasterImage(image_plane, 0,0,256,256)
The channel’s of the noisy image are displayed side-by-side
red_noise <- t(apply(image_plane_noise[,,1],2,rev))
green_noise <- t(apply(image_plane_noise[,,2],2,rev))
blue_noise <- t(apply(image_plane_noise[,,3],2,rev))
red_palette_noise <- colorRampPalette(c("black","red"))
green_palette_noise <- colorRampPalette(c("black","green"))
blue_palette_noise <- colorRampPalette(c("black","blue"))
par(mfrow = c(1,3))
image(red_noise, col = red_palette_noise(256), ann = TRUE, axes = FALSE, main = "RED Channel" , xlab = "",ylab = "")
image(green_noise, col = green_palette_noise(256), ann = TRUE, axes = FALSE, main = "GREEN Channel" , xlab = "",ylab = "")
image(blue_noise, col = blue_palette_noise(256), ann = TRUE, axes = FALSE, main = "BLUE Channel", xlab = "",ylab = "" )
Transformation the image to greyscale. I will use a straightforward approach to do that. The averages of each channel are taken and normalized. Then, the greyscale image is displayed.
image_plane_noise_gray <- image_plane_noise[,,1] + image_plane_noise[,,2] + image_plane_noise[,,3]
image_plane_noise_gray <- image_plane_noise_gray / max(image_plane_noise_gray)
par(mfrow = c(1,1))
plot(x,y, main = "Greyscale Image", axes = FALSE, col = 0)
rasterImage(image_plane_noise_gray,0,0,256,256)
The next step is the PCA analysis. The 25x25 channels are used in the analysis. There will be 232*232 patches.
The PCA analysis, a feature vector is udsed. The feature vector will be the vector of patches. The 25x25 patches will be transformed into vectors with length 625, for each of 232x232 patches.
feature_vector <- rep(NA,625)
image_plane_noise_gray_data <- rep(list(feature_vector), 208*208)
k <- 1
for (i in 13:244) {
for (j in 13:244) {
image_plane_noise_gray_data[[k]] <- as.vector(image_plane_noise_gray[(i-12):(i+12),(j-12):(j+12)])
k <- k+1
}
}
image_plane_noise_gray_data <- as.data.table(matrix(unlist(image_plane_noise_gray_data), ncol = 625, byrow = TRUE))
The data is with dimensions (232x232)x625. The PCA analysis is started.
image_plane_noise_gray_PCA<- princomp (image_plane_noise_gray_data)
plot(image_plane_noise_gray_PCA)
summary(image_plane_noise_gray_PCA)
## Importance of components:
## Comp.1 Comp.2 Comp.3 Comp.4
## Standard deviation 0.86308239 0.38877170 0.35019317 0.277397709
## Proportion of Variance 0.06694861 0.01358396 0.01102180 0.006915806
## Cumulative Proportion 0.06694861 0.08053257 0.09155437 0.098470178
## Comp.5 Comp.6 Comp.7 Comp.8
## Standard deviation 0.24004895 0.222037730 0.217071298 0.18617122
## Proportion of Variance 0.00517889 0.004430887 0.004234888 0.00311503
## Cumulative Proportion 0.10364907 0.108079955 0.112314842 0.11542987
## Comp.9 Comp.10 Comp.11 Comp.12
## Standard deviation 0.185698425 0.17272653 0.15945525 0.157110682
## Proportion of Variance 0.003099228 0.00268136 0.00228515 0.002218444
## Cumulative Proportion 0.118529100 0.12121046 0.12349561 0.125714055
## Comp.13 Comp.14 Comp.15 Comp.16
## Standard deviation 0.15505641 0.148699209 0.14793969 0.145660885
## Proportion of Variance 0.00216081 0.001987259 0.00196701 0.001906878
## Cumulative Proportion 0.12787486 0.129862123 0.13182913 0.133736011
## Comp.17 Comp.18 Comp.19 Comp.20
## Standard deviation 0.144544503 0.140890794 0.140860465 0.14015398
## Proportion of Variance 0.001877761 0.001784031 0.001783263 0.00176542
## Cumulative Proportion 0.135613772 0.137397802 0.139181065 0.14094648
## Comp.21 Comp.22 Comp.23 Comp.24
## Standard deviation 0.139575894 0.1393730 0.139319797 0.13921006
## Proportion of Variance 0.001750886 0.0017458 0.001744467 0.00174172
## Cumulative Proportion 0.142697371 0.1444432 0.146187637 0.14792936
## Comp.25 Comp.26 Comp.27 Comp.28
## Standard deviation 0.13911291 0.139042170 0.13894968 0.13888359
## Proportion of Variance 0.00173929 0.001737521 0.00173521 0.00173356
## Cumulative Proportion 0.14966865 0.151406169 0.15314138 0.15487494
## Comp.29 Comp.30 Comp.31 Comp.32
## Standard deviation 0.138725987 0.138649110 0.138549373 0.138405108
## Proportion of Variance 0.001729628 0.001727712 0.001725227 0.001721636
## Cumulative Proportion 0.156604567 0.158332279 0.160057506 0.161779142
## Comp.33 Comp.34 Comp.35 Comp.36
## Standard deviation 0.13837713 0.13830516 0.13817555 0.137998673
## Proportion of Variance 0.00172094 0.00171915 0.00171593 0.001711539
## Cumulative Proportion 0.16350008 0.16521923 0.16693516 0.168646701
## Comp.37 Comp.38 Comp.39 Comp.40
## Standard deviation 0.1378196 0.137701568 0.137683737 0.137594853
## Proportion of Variance 0.0017071 0.001704178 0.001703736 0.001701537
## Cumulative Proportion 0.1703538 0.172057978 0.173761715 0.175463252
## Comp.41 Comp.42 Comp.43 Comp.44
## Standard deviation 0.13754846 0.137456426 0.137359536 0.137269636
## Proportion of Variance 0.00170039 0.001698115 0.001695722 0.001693503
## Cumulative Proportion 0.17716364 0.178861757 0.180557479 0.182250983
## Comp.45 Comp.46 Comp.47 Comp.48
## Standard deviation 0.136883575 0.13684655 0.136697222 0.13654946
## Proportion of Variance 0.001683991 0.00168308 0.001679409 0.00167578
## Cumulative Proportion 0.183934974 0.18561805 0.187297463 0.18897324
## Comp.49 Comp.50 Comp.51 Comp.52
## Standard deviation 0.13652663 0.136502695 0.136360493 0.136333318
## Proportion of Variance 0.00167522 0.001674633 0.001671145 0.001670479
## Cumulative Proportion 0.19064846 0.192323095 0.193994241 0.195664720
## Comp.53 Comp.54 Comp.55 Comp.56
## Standard deviation 0.13625864 0.136109159 0.135850941 0.135822011
## Proportion of Variance 0.00166865 0.001664991 0.001658679 0.001657973
## Cumulative Proportion 0.19733337 0.198998360 0.200657039 0.202315012
## Comp.57 Comp.58 Comp.59 Comp.60
## Standard deviation 0.13576372 0.135686634 0.135539307 0.135457213
## Proportion of Variance 0.00165655 0.001654669 0.001651078 0.001649079
## Cumulative Proportion 0.20397156 0.205626232 0.207277310 0.208926388
## Comp.61 Comp.62 Comp.63 Comp.64
## Standard deviation 0.135324749 0.135269335 0.135183559 0.135127037
## Proportion of Variance 0.001645855 0.001644507 0.001642422 0.001641049
## Cumulative Proportion 0.210572243 0.212216750 0.213859173 0.215500222
## Comp.65 Comp.66 Comp.67 Comp.68
## Standard deviation 0.134981404 0.134956419 0.134789315 0.134717784
## Proportion of Variance 0.001637514 0.001636908 0.001632856 0.001631124
## Cumulative Proportion 0.217137736 0.218774643 0.220407500 0.222038624
## Comp.69 Comp.70 Comp.71 Comp.72
## Standard deviation 0.134652873 0.134592300 0.134550832 0.134502372
## Proportion of Variance 0.001629552 0.001628087 0.001627084 0.001625912
## Cumulative Proportion 0.223668176 0.225296263 0.226923346 0.228549258
## Comp.73 Comp.74 Comp.75 Comp.76
## Standard deviation 0.134469994 0.13434422 0.134289386 0.13423526
## Proportion of Variance 0.001625129 0.00162209 0.001620767 0.00161946
## Cumulative Proportion 0.230174387 0.23179648 0.233417244 0.23503670
## Comp.77 Comp.78 Comp.79 Comp.80
## Standard deviation 0.134211827 0.134147023 0.134114820 0.134049754
## Proportion of Variance 0.001618895 0.001617332 0.001616556 0.001614987
## Cumulative Proportion 0.236655599 0.238272931 0.239889487 0.241504474
## Comp.81 Comp.82 Comp.83 Comp.84
## Standard deviation 0.134032095 0.133975098 0.13390578 0.133888923
## Proportion of Variance 0.001614562 0.001613189 0.00161152 0.001611114
## Cumulative Proportion 0.243119036 0.244732225 0.24634375 0.247954859
## Comp.85 Comp.86 Comp.87 Comp.88
## Standard deviation 0.133830484 0.133810466 0.133774530 0.133750598
## Proportion of Variance 0.001609708 0.001609227 0.001608363 0.001607787
## Cumulative Proportion 0.249564568 0.251173794 0.252782157 0.254389944
## Comp.89 Comp.90 Comp.91 Comp.92
## Standard deviation 0.133635890 0.133559560 0.13353091 0.133513714
## Proportion of Variance 0.001605031 0.001603198 0.00160251 0.001602097
## Cumulative Proportion 0.255994975 0.257598172 0.25920068 0.260802779
## Comp.93 Comp.94 Comp.95 Comp.96
## Standard deviation 0.133453250 0.133410546 0.133318138 0.133294178
## Proportion of Variance 0.001600646 0.001599622 0.001597407 0.001596833
## Cumulative Proportion 0.262403426 0.264003048 0.265600455 0.267197287
## Comp.97 Comp.98 Comp.99 Comp.100
## Standard deviation 0.133225818 0.133204041 0.133173412 0.133124195
## Proportion of Variance 0.001595195 0.001594674 0.001593941 0.001592763
## Cumulative Proportion 0.268792483 0.270387157 0.271981097 0.273573860
## Comp.101 Comp.102 Comp.103 Comp.104
## Standard deviation 0.133067404 0.133026839 0.132995856 0.132965018
## Proportion of Variance 0.001591404 0.001590434 0.001589693 0.001588956
## Cumulative Proportion 0.275165264 0.276755698 0.278345391 0.279934347
## Comp.105 Comp.106 Comp.107 Comp.108
## Standard deviation 0.132915110 0.132860853 0.132841611 0.132820926
## Proportion of Variance 0.001587763 0.001586467 0.001586008 0.001585514
## Cumulative Proportion 0.281522111 0.283108578 0.284694586 0.286280100
## Comp.109 Comp.110 Comp.111 Comp.112
## Standard deviation 0.132769297 0.132757330 0.132728215 0.132645211
## Proportion of Variance 0.001584282 0.001583996 0.001583301 0.001581322
## Cumulative Proportion 0.287864382 0.289448378 0.291031679 0.292613001
## Comp.113 Comp.114 Comp.115 Comp.116
## Standard deviation 0.132602912 0.132573348 0.132536359 0.132511072
## Proportion of Variance 0.001580313 0.001579609 0.001578727 0.001578125
## Cumulative Proportion 0.294193314 0.295772923 0.297351650 0.298929775
## Comp.117 Comp.118 Comp.119 Comp.120
## Standard deviation 0.132458227 0.132358902 0.132321288 0.132297576
## Proportion of Variance 0.001576867 0.001574503 0.001573608 0.001573044
## Cumulative Proportion 0.300506642 0.302081145 0.303654752 0.305227796
## Comp.121 Comp.122 Comp.123 Comp.124
## Standard deviation 0.132274311 0.13220445 0.132116490 0.132071606
## Proportion of Variance 0.001572491 0.00157083 0.001568741 0.001567675
## Cumulative Proportion 0.306800287 0.30837112 0.309939858 0.311507533
## Comp.125 Comp.126 Comp.127 Comp.128
## Standard deviation 0.132013038 0.132008839 0.131937324 0.131901026
## Proportion of Variance 0.001566285 0.001566185 0.001564489 0.001563628
## Cumulative Proportion 0.313073818 0.314640003 0.316204491 0.317768119
## Comp.129 Comp.130 Comp.131 Comp.132
## Standard deviation 0.131834234 0.131812250 0.131808442 0.131786051
## Proportion of Variance 0.001562045 0.001561524 0.001561434 0.001560903
## Cumulative Proportion 0.319330164 0.320891688 0.322453122 0.324014025
## Comp.133 Comp.134 Comp.135 Comp.136
## Standard deviation 0.13175087 0.131699141 0.131672693 0.13163429
## Proportion of Variance 0.00156007 0.001558845 0.001558219 0.00155731
## Cumulative Proportion 0.32557409 0.327132940 0.328691159 0.33024847
## Comp.137 Comp.138 Comp.139 Comp.140
## Standard deviation 0.1316170 0.131591774 0.131542634 0.131519502
## Proportion of Variance 0.0015569 0.001556304 0.001555142 0.001554595
## Cumulative Proportion 0.3318054 0.333361674 0.334916817 0.336471412
## Comp.141 Comp.142 Comp.143 Comp.144
## Standard deviation 0.131464054 0.131462456 0.131416824 0.131412685
## Proportion of Variance 0.001553285 0.001553247 0.001552169 0.001552071
## Cumulative Proportion 0.338024697 0.339577944 0.341130113 0.342682184
## Comp.145 Comp.146 Comp.147 Comp.148
## Standard deviation 0.13135294 0.131319187 0.131290905 0.131270389
## Proportion of Variance 0.00155066 0.001549864 0.001549196 0.001548712
## Cumulative Proportion 0.34423284 0.345782708 0.347331904 0.348880616
## Comp.149 Comp.150 Comp.151 Comp.152
## Standard deviation 0.131247516 0.131216935 0.131163391 0.131125014
## Proportion of Variance 0.001548172 0.001547451 0.001546188 0.001545284
## Cumulative Proportion 0.350428788 0.351976239 0.353522427 0.355067711
## Comp.153 Comp.154 Comp.155 Comp.156
## Standard deviation 0.131108115 0.131085426 0.131047772 0.131042331
## Proportion of Variance 0.001544885 0.001544351 0.001543464 0.001543335
## Cumulative Proportion 0.356612596 0.358156947 0.359700410 0.361243746
## Comp.157 Comp.158 Comp.159 Comp.160
## Standard deviation 0.130936156 0.130923310 0.130849871 0.13083433
## Proportion of Variance 0.001540835 0.001540533 0.001538805 0.00153844
## Cumulative Proportion 0.362784581 0.364325114 0.365863920 0.36740236
## Comp.161 Comp.162 Comp.163 Comp.164
## Standard deviation 0.130827879 0.130787935 0.130727402 0.130697877
## Proportion of Variance 0.001538288 0.001537349 0.001535926 0.001535232
## Cumulative Proportion 0.368940647 0.370477996 0.372013923 0.373549155
## Comp.165 Comp.166 Comp.167 Comp.168
## Standard deviation 0.130668559 0.130652183 0.130562519 0.130553776
## Proportion of Variance 0.001534544 0.001534159 0.001532054 0.001531849
## Cumulative Proportion 0.375083699 0.376617858 0.378149912 0.379681761
## Comp.169 Comp.170 Comp.171 Comp.172
## Standard deviation 0.130543710 0.13051802 0.130474422 0.130405322
## Proportion of Variance 0.001531613 0.00153101 0.001529987 0.001528367
## Cumulative Proportion 0.381213374 0.38274438 0.384274371 0.385802739
## Comp.173 Comp.174 Comp.175 Comp.176
## Standard deviation 0.13038197 0.130349750 0.130320193 0.130264482
## Proportion of Variance 0.00152782 0.001527065 0.001526372 0.001525068
## Cumulative Proportion 0.38733056 0.388857623 0.390383996 0.391909063
## Comp.177 Comp.178 Comp.179 Comp.180
## Standard deviation 0.13024579 0.130221776 0.130205817 0.130161446
## Proportion of Variance 0.00152463 0.001524068 0.001523694 0.001522656
## Cumulative Proportion 0.39343369 0.394957761 0.396481456 0.398004112
## Comp.181 Comp.182 Comp.183 Comp.184
## Standard deviation 0.130132895 0.130072206 0.130061064 0.130050247
## Proportion of Variance 0.001521988 0.001520569 0.001520308 0.001520056
## Cumulative Proportion 0.399526100 0.401046669 0.402566977 0.404087033
## Comp.185 Comp.186 Comp.187 Comp.188
## Standard deviation 0.130015096 0.130010105 0.129992438 0.129938114
## Proportion of Variance 0.001519234 0.001519117 0.001518704 0.001517435
## Cumulative Proportion 0.405606267 0.407125384 0.408644088 0.410161524
## Comp.189 Comp.190 Comp.191 Comp.192
## Standard deviation 0.129913718 0.12988651 0.12987751 0.129861812
## Proportion of Variance 0.001516866 0.00151623 0.00151602 0.001515654
## Cumulative Proportion 0.411678389 0.41319462 0.41471064 0.416226294
## Comp.193 Comp.194 Comp.195 Comp.196
## Standard deviation 0.129787358 0.129753754 0.129722296 0.129667051
## Proportion of Variance 0.001513916 0.001513132 0.001512399 0.001511111
## Cumulative Proportion 0.417740210 0.419253342 0.420765741 0.422276852
## Comp.197 Comp.198 Comp.199 Comp.200
## Standard deviation 0.129648942 0.12961680 0.129553388 0.129546425
## Proportion of Variance 0.001510689 0.00150994 0.001508463 0.001508301
## Cumulative Proportion 0.423787541 0.42529748 0.426805944 0.428314245
## Comp.201 Comp.202 Comp.203 Comp.204
## Standard deviation 0.129528563 0.129517123 0.129470253 0.129446345
## Proportion of Variance 0.001507885 0.001507619 0.001506528 0.001505971
## Cumulative Proportion 0.429822129 0.431329748 0.432836275 0.434342247
## Comp.205 Comp.206 Comp.207 Comp.208
## Standard deviation 0.12940544 0.129377037 0.129337587 0.129287399
## Proportion of Variance 0.00150502 0.001504359 0.001503442 0.001502275
## Cumulative Proportion 0.43584727 0.437351625 0.438855067 0.440357342
## Comp.209 Comp.210 Comp.211 Comp.212
## Standard deviation 0.12925534 0.12921485 0.129167852 0.129140254
## Proportion of Variance 0.00150153 0.00150059 0.001499498 0.001498858
## Cumulative Proportion 0.44185887 0.44335946 0.444858960 0.446357818
## Comp.213 Comp.214 Comp.215 Comp.216
## Standard deviation 0.129119772 0.129113573 0.129074390 0.129056729
## Proportion of Variance 0.001498382 0.001498238 0.001497329 0.001496919
## Cumulative Proportion 0.447856200 0.449354438 0.450851767 0.452348687
## Comp.217 Comp.218 Comp.219 Comp.220
## Standard deviation 0.129014871 0.12899078 0.128945732 0.128925952
## Proportion of Variance 0.001495948 0.00149539 0.001494346 0.001493887
## Cumulative Proportion 0.453844635 0.45534002 0.456834370 0.458328258
## Comp.221 Comp.222 Comp.223 Comp.224
## Standard deviation 0.128878220 0.128864072 0.128833230 0.128777778
## Proportion of Variance 0.001492781 0.001492453 0.001491739 0.001490455
## Cumulative Proportion 0.459821039 0.461313492 0.462805231 0.464295686
## Comp.225 Comp.226 Comp.227 Comp.228
## Standard deviation 0.128757220 0.128701662 0.128680424 0.128624294
## Proportion of Variance 0.001489979 0.001488694 0.001488203 0.001486905
## Cumulative Proportion 0.465785666 0.467274360 0.468762562 0.470249467
## Comp.229 Comp.230 Comp.231 Comp.232
## Standard deviation 0.128608189 0.128598832 0.128587176 0.128511970
## Proportion of Variance 0.001486532 0.001486316 0.001486047 0.001484309
## Cumulative Proportion 0.471735999 0.473222315 0.474708361 0.476192670
## Comp.233 Comp.234 Comp.235 Comp.236
## Standard deviation 0.128501232 0.128464100 0.128429033 0.128398613
## Proportion of Variance 0.001484061 0.001483203 0.001482394 0.001481691
## Cumulative Proportion 0.477676731 0.479159934 0.480642328 0.482124019
## Comp.237 Comp.238 Comp.239 Comp.240
## Standard deviation 0.128376790 0.128359199 0.128293151 0.128265625
## Proportion of Variance 0.001481188 0.001480782 0.001479258 0.001478624
## Cumulative Proportion 0.483605207 0.485085989 0.486565247 0.488043871
## Comp.241 Comp.242 Comp.243 Comp.244
## Standard deviation 0.128226511 0.128217874 0.12820473 0.128178817
## Proportion of Variance 0.001477722 0.001477523 0.00147722 0.001476623
## Cumulative Proportion 0.489521593 0.490999115 0.49247634 0.493952958
## Comp.245 Comp.246 Comp.247 Comp.248
## Standard deviation 0.128158000 0.128135415 0.128085204 0.128068903
## Proportion of Variance 0.001476143 0.001475623 0.001474467 0.001474092
## Cumulative Proportion 0.495429102 0.496904725 0.498379192 0.499853283
## Comp.249 Comp.250 Comp.251 Comp.252
## Standard deviation 0.128037601 0.127991408 0.127958508 0.127926209
## Proportion of Variance 0.001473371 0.001472308 0.001471551 0.001470809
## Cumulative Proportion 0.501326654 0.502798962 0.504270514 0.505741322
## Comp.253 Comp.254 Comp.255 Comp.256
## Standard deviation 0.127861294 0.127818194 0.127776749 0.127761853
## Proportion of Variance 0.001469316 0.001468326 0.001467374 0.001467032
## Cumulative Proportion 0.507210638 0.508678964 0.510146338 0.511613370
## Comp.257 Comp.258 Comp.259 Comp.260
## Standard deviation 0.127742895 0.127731540 0.127670167 0.127664386
## Proportion of Variance 0.001466596 0.001466336 0.001464927 0.001464794
## Cumulative Proportion 0.513079966 0.514546302 0.516011229 0.517476023
## Comp.261 Comp.262 Comp.263 Comp.264
## Standard deviation 0.127615363 0.127583768 0.127539557 0.127533315
## Proportion of Variance 0.001463669 0.001462945 0.001461931 0.001461788
## Cumulative Proportion 0.518939692 0.520402637 0.521864568 0.523326356
## Comp.265 Comp.266 Comp.267 Comp.268
## Standard deviation 0.12747799 0.127455763 0.127413518 0.127392457
## Proportion of Variance 0.00146052 0.001460011 0.001459043 0.001458561
## Cumulative Proportion 0.52478688 0.526246887 0.527705930 0.529164490
## Comp.269 Comp.270 Comp.271 Comp.272
## Standard deviation 0.12736493 0.127338462 0.127317203 0.127287323
## Proportion of Variance 0.00145793 0.001457325 0.001456838 0.001456154
## Cumulative Proportion 0.53062242 0.532079745 0.533536583 0.534992737
## Comp.273 Comp.274 Comp.275 Comp.276
## Standard deviation 0.127216156 0.127184352 0.127158166 0.127117662
## Proportion of Variance 0.001454526 0.001453799 0.001453201 0.001452275
## Cumulative Proportion 0.536447264 0.537901063 0.539354264 0.540806539
## Comp.277 Comp.278 Comp.279 Comp.280
## Standard deviation 0.127077569 0.127067233 0.127016675 0.126978309
## Proportion of Variance 0.001451359 0.001451123 0.001449968 0.001449093
## Cumulative Proportion 0.542257898 0.543709021 0.545158990 0.546608082
## Comp.281 Comp.282 Comp.283 Comp.284
## Standard deviation 0.126970098 0.12693262 0.126922476 0.126887841
## Proportion of Variance 0.001448905 0.00144805 0.001447819 0.001447029
## Cumulative Proportion 0.548056987 0.54950504 0.550952856 0.552399885
## Comp.285 Comp.286 Comp.287 Comp.288
## Standard deviation 0.126864060 0.126802452 0.126779705 0.126761963
## Proportion of Variance 0.001446486 0.001445082 0.001444563 0.001444159
## Cumulative Proportion 0.553846371 0.555291453 0.556736016 0.558180175
## Comp.289 Comp.290 Comp.291 Comp.292
## Standard deviation 0.126724769 0.126695869 0.126688858 0.126624824
## Proportion of Variance 0.001443312 0.001442653 0.001442494 0.001441036
## Cumulative Proportion 0.559623486 0.561066140 0.562508633 0.563949669
## Comp.293 Comp.294 Comp.295 Comp.296
## Standard deviation 0.12659470 0.126571896 0.126526472 0.126514369
## Proportion of Variance 0.00144035 0.001439831 0.001438798 0.001438523
## Cumulative Proportion 0.56539002 0.566829851 0.568268649 0.569707172
## Comp.297 Comp.298 Comp.299 Comp.300
## Standard deviation 0.126468281 0.126436431 0.126385409 0.126363056
## Proportion of Variance 0.001437475 0.001436751 0.001435592 0.001435084
## Cumulative Proportion 0.571144647 0.572581398 0.574016990 0.575452074
## Comp.301 Comp.302 Comp.303 Comp.304
## Standard deviation 0.126315067 0.12626774 0.126250621 0.12621661
## Proportion of Variance 0.001433994 0.00143292 0.001432531 0.00143176
## Cumulative Proportion 0.576886068 0.57831899 0.579751519 0.58118328
## Comp.305 Comp.306 Comp.307 Comp.308
## Standard deviation 0.126173127 0.126155973 0.126151259 0.126126583
## Proportion of Variance 0.001430773 0.001430384 0.001430277 0.001429718
## Cumulative Proportion 0.582614052 0.584044436 0.585474714 0.586904432
## Comp.309 Comp.310 Comp.311 Comp.312
## Standard deviation 0.126108074 0.126055943 0.126040140 0.125980633
## Proportion of Variance 0.001429298 0.001428117 0.001427759 0.001426411
## Cumulative Proportion 0.588333730 0.589761847 0.591189605 0.592616016
## Comp.313 Comp.314 Comp.315 Comp.316
## Standard deviation 0.125936313 0.12591741 0.125885957 0.125867538
## Proportion of Variance 0.001425407 0.00142498 0.001424268 0.001423851
## Cumulative Proportion 0.594041424 0.59546640 0.596890671 0.598314522
## Comp.317 Comp.318 Comp.319 Comp.320
## Standard deviation 0.125844817 0.12579939 0.125788924 0.125779724
## Proportion of Variance 0.001423337 0.00142231 0.001422073 0.001421865
## Cumulative Proportion 0.599737859 0.60116017 0.602582242 0.604004107
## Comp.321 Comp.322 Comp.323 Comp.324
## Standard deviation 0.12573351 0.125713893 0.125694636 0.125656107
## Proportion of Variance 0.00142082 0.001420377 0.001419942 0.001419072
## Cumulative Proportion 0.60542493 0.606845304 0.608265246 0.609684318
## Comp.325 Comp.326 Comp.327 Comp.328
## Standard deviation 0.125573969 0.125533622 0.125474032 0.125451598
## Proportion of Variance 0.001417217 0.001416306 0.001414962 0.001414456
## Cumulative Proportion 0.611101535 0.612517841 0.613932803 0.615347259
## Comp.329 Comp.330 Comp.331 Comp.332
## Standard deviation 0.125425497 0.125417871 0.125380202 0.125343313
## Proportion of Variance 0.001413868 0.001413696 0.001412847 0.001412015
## Cumulative Proportion 0.616761127 0.618174822 0.619587669 0.620999684
## Comp.333 Comp.334 Comp.335 Comp.336
## Standard deviation 0.125338483 0.12526981 0.125247094 0.125211530
## Proportion of Variance 0.001411907 0.00141036 0.001409848 0.001409048
## Cumulative Proportion 0.622411591 0.62382195 0.625231799 0.626640847
## Comp.337 Comp.338 Comp.339 Comp.340
## Standard deviation 0.125197795 0.12513874 0.125118511 0.125074763
## Proportion of Variance 0.001408739 0.00140741 0.001406955 0.001405971
## Cumulative Proportion 0.628049586 0.62945700 0.630863951 0.632269922
## Comp.341 Comp.342 Comp.343 Comp.344
## Standard deviation 0.125031646 0.124985569 0.124973043 0.12496170
## Proportion of Variance 0.001405002 0.001403967 0.001403685 0.00140343
## Cumulative Proportion 0.633674924 0.635078891 0.636482576 0.63788601
## Comp.345 Comp.346 Comp.347 Comp.348
## Standard deviation 0.124946198 0.12492115 0.124874000 0.124849102
## Proportion of Variance 0.001403082 0.00140252 0.001401461 0.001400903
## Cumulative Proportion 0.639289089 0.64069161 0.642093070 0.643493973
## Comp.349 Comp.350 Comp.351 Comp.352
## Standard deviation 0.124829788 0.124801061 0.124773247 0.124735535
## Proportion of Variance 0.001400469 0.001399825 0.001399201 0.001398355
## Cumulative Proportion 0.644894442 0.646294267 0.647693467 0.649091823
## Comp.353 Comp.354 Comp.355 Comp.356
## Standard deviation 0.124725684 0.124680981 0.124656507 0.124606858
## Proportion of Variance 0.001398134 0.001397132 0.001396584 0.001395472
## Cumulative Proportion 0.650489957 0.651887089 0.653283673 0.654679144
## Comp.357 Comp.358 Comp.359 Comp.360
## Standard deviation 0.124559659 0.124513626 0.124502435 0.124485007
## Proportion of Variance 0.001394415 0.001393384 0.001393134 0.001392744
## Cumulative Proportion 0.656073559 0.657466943 0.658860077 0.660252820
## Comp.361 Comp.362 Comp.363 Comp.364
## Standard deviation 0.124453142 0.124404936 0.124398192 0.12436545
## Proportion of Variance 0.001392031 0.001390953 0.001390802 0.00139007
## Cumulative Proportion 0.661644851 0.663035803 0.664426605 0.66581667
## Comp.365 Comp.366 Comp.367 Comp.368
## Standard deviation 0.124324522 0.124297939 0.12427863 0.124216178
## Proportion of Variance 0.001389155 0.001388561 0.00138813 0.001386735
## Cumulative Proportion 0.667205830 0.668594391 0.66998252 0.671369255
## Comp.369 Comp.370 Comp.371 Comp.372
## Standard deviation 0.124176477 0.12415370 0.124128852 0.124066103
## Proportion of Variance 0.001385848 0.00138534 0.001384786 0.001383386
## Cumulative Proportion 0.672755103 0.67414044 0.675525229 0.676908615
## Comp.373 Comp.374 Comp.375 Comp.376
## Standard deviation 0.124038671 0.123991770 0.123980521 0.123946124
## Proportion of Variance 0.001382774 0.001381729 0.001381478 0.001380712
## Cumulative Proportion 0.678291389 0.679673118 0.681054596 0.682435308
## Comp.377 Comp.378 Comp.379 Comp.380
## Standard deviation 0.123923756 0.123914085 0.123881739 0.123848020
## Proportion of Variance 0.001380213 0.001379998 0.001379278 0.001378527
## Cumulative Proportion 0.683815521 0.685195519 0.686574797 0.687953324
## Comp.381 Comp.382 Comp.383 Comp.384
## Standard deviation 0.123826639 0.123777266 0.123766103 0.123721262
## Proportion of Variance 0.001378051 0.001376952 0.001376704 0.001375706
## Cumulative Proportion 0.689331375 0.690708327 0.692085031 0.693460737
## Comp.385 Comp.386 Comp.387 Comp.388
## Standard deviation 0.123657786 0.123625583 0.123609026 0.123583067
## Proportion of Variance 0.001374295 0.001373579 0.001373212 0.001372635
## Cumulative Proportion 0.694835032 0.696208612 0.697581823 0.698954458
## Comp.389 Comp.390 Comp.391 Comp.392
## Standard deviation 0.1235500 0.123523169 0.123511522 0.12346799
## Proportion of Variance 0.0013719 0.001371305 0.001371046 0.00137008
## Cumulative Proportion 0.7003264 0.701697662 0.703068708 0.70443879
## Comp.393 Comp.394 Comp.395 Comp.396
## Standard deviation 0.123444842 0.123411552 0.123349070 0.123323612
## Proportion of Variance 0.001369566 0.001368827 0.001367442 0.001366877
## Cumulative Proportion 0.705808354 0.707177182 0.708544623 0.709911501
## Comp.397 Comp.398 Comp.399 Comp.400
## Standard deviation 0.12329487 0.123284975 0.123231400 0.12321814
## Proportion of Variance 0.00136624 0.001366021 0.001364834 0.00136454
## Cumulative Proportion 0.71127774 0.712643762 0.714008596 0.71537314
## Comp.401 Comp.402 Comp.403 Comp.404
## Standard deviation 0.123199956 0.12315851 0.123129372 0.123094140
## Proportion of Variance 0.001364138 0.00136322 0.001362575 0.001361795
## Cumulative Proportion 0.716737274 0.71810049 0.719463069 0.720824864
## Comp.405 Comp.406 Comp.407 Comp.408
## Standard deviation 0.123081006 0.123036263 0.123016834 0.122972076
## Proportion of Variance 0.001361505 0.001360515 0.001360085 0.001359096
## Cumulative Proportion 0.722186369 0.723546884 0.724906969 0.726266065
## Comp.409 Comp.410 Comp.411 Comp.412
## Standard deviation 0.122895272 0.122882499 0.122859031 0.122851160
## Proportion of Variance 0.001357399 0.001357117 0.001356598 0.001356424
## Cumulative Proportion 0.727623464 0.728980581 0.730337179 0.731693603
## Comp.413 Comp.414 Comp.415 Comp.416
## Standard deviation 0.122811317 0.122771787 0.122726744 0.1226779
## Proportion of Variance 0.001355545 0.001354672 0.001353678 0.0013526
## Cumulative Proportion 0.733049148 0.734403820 0.735757499 0.7371101
## Comp.417 Comp.418 Comp.419 Comp.420
## Standard deviation 0.122644439 0.122607602 0.122566359 0.122528814
## Proportion of Variance 0.001351863 0.001351051 0.001350143 0.001349316
## Cumulative Proportion 0.738461963 0.739813014 0.741163157 0.742512472
## Comp.421 Comp.422 Comp.423 Comp.424
## Standard deviation 0.122470205 0.1224554 0.122405082 0.122371266
## Proportion of Variance 0.001348025 0.0013477 0.001346592 0.001345848
## Cumulative Proportion 0.743860497 0.7452082 0.746554789 0.747900637
## Comp.425 Comp.426 Comp.427 Comp.428
## Standard deviation 0.122338105 0.122276200 0.122232946 0.122230062
## Proportion of Variance 0.001345119 0.001343758 0.001342807 0.001342744
## Cumulative Proportion 0.749245756 0.750589513 0.751932320 0.753275064
## Comp.429 Comp.430 Comp.431 Comp.432
## Standard deviation 0.122178160 0.122143026 0.122084045 0.122043775
## Proportion of Variance 0.001341604 0.001340832 0.001339538 0.001338654
## Cumulative Proportion 0.754616668 0.755957500 0.757297038 0.758635692
## Comp.433 Comp.434 Comp.435 Comp.436
## Standard deviation 0.122029119 0.122001490 0.121980438 0.121944981
## Proportion of Variance 0.001338333 0.001337727 0.001337265 0.001336488
## Cumulative Proportion 0.759974024 0.761311751 0.762649016 0.763985503
## Comp.437 Comp.438 Comp.439 Comp.440
## Standard deviation 0.12188712 0.121885351 0.121864137 0.121824306
## Proportion of Variance 0.00133522 0.001335181 0.001334716 0.001333844
## Cumulative Proportion 0.76532072 0.766655904 0.767990620 0.769324464
## Comp.441 Comp.442 Comp.443 Comp.444
## Standard deviation 0.121755742 0.121723268 0.121684732 0.121662402
## Proportion of Variance 0.001332343 0.001331632 0.001330789 0.001330301
## Cumulative Proportion 0.770656807 0.771988439 0.773319228 0.774649529
## Comp.445 Comp.446 Comp.447 Comp.448
## Standard deviation 0.121629260 0.121600910 0.121567836 0.121489476
## Proportion of Variance 0.001329576 0.001328956 0.001328234 0.001326522
## Cumulative Proportion 0.775979105 0.777308061 0.778636295 0.779962817
## Comp.449 Comp.450 Comp.451 Comp.452
## Standard deviation 0.12147702 0.12144587 0.1214198 0.121385907
## Proportion of Variance 0.00132625 0.00132557 0.0013250 0.001324261
## Cumulative Proportion 0.78128907 0.78261464 0.7839396 0.785263897
## Comp.453 Comp.454 Comp.455 Comp.456
## Standard deviation 0.121378228 0.121319527 0.121279196 0.121199874
## Proportion of Variance 0.001324094 0.001322813 0.001321934 0.001320205
## Cumulative Proportion 0.786587991 0.787910804 0.789232738 0.790552943
## Comp.457 Comp.458 Comp.459 Comp.460
## Standard deviation 0.121154479 0.121087962 0.121080909 0.12100990
## Proportion of Variance 0.001319216 0.001317768 0.001317615 0.00131607
## Cumulative Proportion 0.791872159 0.793189927 0.794507542 0.79582361
## Comp.461 Comp.462 Comp.463 Comp.464
## Standard deviation 0.120993719 0.120966306 0.12091747 0.120877512
## Proportion of Variance 0.001315718 0.001315122 0.00131406 0.001313192
## Cumulative Proportion 0.797139330 0.798454451 0.79976851 0.801081703
## Comp.465 Comp.466 Comp.467 Comp.468
## Standard deviation 0.12082543 0.120818800 0.120757115 0.120743185
## Proportion of Variance 0.00131206 0.001311916 0.001310577 0.001310275
## Cumulative Proportion 0.80239376 0.803705679 0.805016256 0.806326531
## Comp.469 Comp.470 Comp.471 Comp.472
## Standard deviation 0.120704411 0.120667820 0.120640427 0.120539810
## Proportion of Variance 0.001309433 0.001308639 0.001308045 0.001305864
## Cumulative Proportion 0.807635964 0.808944604 0.810252649 0.811558513
## Comp.473 Comp.474 Comp.475 Comp.476
## Standard deviation 0.120518805 0.120496525 0.120465011 0.120450201
## Proportion of Variance 0.001305409 0.001304927 0.001304244 0.001303924
## Cumulative Proportion 0.812863923 0.814168850 0.815473094 0.816777017
## Comp.477 Comp.478 Comp.479 Comp.480
## Standard deviation 0.120401684 0.120375607 0.12034421 0.120294140
## Proportion of Variance 0.001302873 0.001302309 0.00130163 0.001300547
## Cumulative Proportion 0.818079891 0.819382200 0.82068383 0.821984377
## Comp.481 Comp.482 Comp.483 Comp.484
## Standard deviation 0.120259751 0.120226106 0.120186068 0.120095658
## Proportion of Variance 0.001299803 0.001299076 0.001298211 0.001296259
## Cumulative Proportion 0.823284180 0.824583256 0.825881467 0.827177726
## Comp.485 Comp.486 Comp.487 Comp.488
## Standard deviation 0.12007671 0.120003846 0.119998669 0.119943608
## Proportion of Variance 0.00129585 0.001294278 0.001294166 0.001292978
## Cumulative Proportion 0.82847358 0.829767853 0.831062019 0.832354998
## Comp.489 Comp.490 Comp.491 Comp.492
## Standard deviation 0.119889785 0.119861898 0.119845616 0.119794985
## Proportion of Variance 0.001291818 0.001291217 0.001290867 0.001289776
## Cumulative Proportion 0.833646816 0.834938034 0.836228900 0.837518676
## Comp.493 Comp.494 Comp.495 Comp.496
## Standard deviation 0.119744571 0.119715536 0.119707700 0.119648121
## Proportion of Variance 0.001288691 0.001288066 0.001287897 0.001286616
## Cumulative Proportion 0.838807367 0.840095433 0.841383331 0.842669946
## Comp.497 Comp.498 Comp.499 Comp.500
## Standard deviation 0.119635525 0.119610826 0.119555890 0.11953902
## Proportion of Variance 0.001286345 0.001285814 0.001284633 0.00128427
## Cumulative Proportion 0.843956291 0.845242105 0.846526738 0.84781101
## Comp.501 Comp.502 Comp.503 Comp.504
## Standard deviation 0.119524479 0.119455476 0.119425447 0.119414903
## Proportion of Variance 0.001283958 0.001282476 0.001281831 0.001281605
## Cumulative Proportion 0.849094966 0.850377442 0.851659273 0.852940878
## Comp.505 Comp.506 Comp.507 Comp.508
## Standard deviation 0.119357538 0.119342493 0.11931167 0.11926922
## Proportion of Variance 0.001280374 0.001280051 0.00127939 0.00127848
## Cumulative Proportion 0.854221252 0.855501303 0.85678069 0.85805917
## Comp.509 Comp.510 Comp.511 Comp.512
## Standard deviation 0.119261055 0.119192975 0.11915119 0.119127601
## Proportion of Variance 0.001278305 0.001276846 0.00127595 0.001275445
## Cumulative Proportion 0.859337477 0.860614323 0.86189027 0.863165719
## Comp.513 Comp.514 Comp.515 Comp.516
## Standard deviation 0.119080929 0.119045248 0.119003164 0.118985945
## Proportion of Variance 0.001274446 0.001273683 0.001272782 0.001272414
## Cumulative Proportion 0.864440165 0.865713848 0.866986630 0.868259044
## Comp.517 Comp.518 Comp.519 Comp.520
## Standard deviation 0.118936891 0.118860491 0.118827727 0.118808615
## Proportion of Variance 0.001271365 0.001269732 0.001269032 0.001268624
## Cumulative Proportion 0.869530409 0.870800141 0.872069173 0.873337797
## Comp.521 Comp.522 Comp.523 Comp.524
## Standard deviation 0.118729339 0.118713192 0.118697554 0.118649373
## Proportion of Variance 0.001266932 0.001266587 0.001266253 0.001265226
## Cumulative Proportion 0.874604729 0.875871316 0.877137569 0.878402795
## Comp.525 Comp.526 Comp.527 Comp.528
## Standard deviation 0.118605389 0.118599606 0.118516561 0.118457281
## Proportion of Variance 0.001264288 0.001264164 0.001262395 0.001261132
## Cumulative Proportion 0.879667083 0.880931247 0.882193642 0.883454774
## Comp.529 Comp.530 Comp.531 Comp.532
## Standard deviation 0.118432976 0.11837075 0.118354814 0.118316850
## Proportion of Variance 0.001260615 0.00125929 0.001258951 0.001258144
## Cumulative Proportion 0.884715389 0.88597468 0.887233630 0.888491774
## Comp.533 Comp.534 Comp.535 Comp.536
## Standard deviation 0.118291863 0.118209726 0.118205223 0.11816848
## Proportion of Variance 0.001257612 0.001255867 0.001255771 0.00125499
## Cumulative Proportion 0.889749387 0.891005253 0.892261024 0.89351601
## Comp.537 Comp.538 Comp.539 Comp.540
## Standard deviation 0.11811810 0.118098051 0.118058356 0.117990889
## Proportion of Variance 0.00125392 0.001253495 0.001252652 0.001251221
## Cumulative Proportion 0.89476993 0.896023430 0.897276082 0.898527303
## Comp.541 Comp.542 Comp.543 Comp.544
## Standard deviation 0.117975910 0.11794463 0.117854638 0.117823297
## Proportion of Variance 0.001250903 0.00125024 0.001248333 0.001247669
## Cumulative Proportion 0.899778206 0.90102845 0.902276779 0.903524449
## Comp.545 Comp.546 Comp.547 Comp.548
## Standard deviation 0.117763481 0.117722642 0.117603135 0.117558558
## Proportion of Variance 0.001246403 0.001245538 0.001243011 0.001242069
## Cumulative Proportion 0.904770851 0.906016390 0.907259400 0.908501469
## Comp.549 Comp.550 Comp.551 Comp.552
## Standard deviation 0.117522725 0.117468921 0.117411170 0.117336437
## Proportion of Variance 0.001241312 0.001240175 0.001238956 0.001237379
## Cumulative Proportion 0.909742780 0.910982956 0.912221912 0.913459291
## Comp.553 Comp.554 Comp.555 Comp.556
## Standard deviation 0.11730372 0.117284680 0.117200694 0.117191499
## Proportion of Variance 0.00123669 0.001236288 0.001234518 0.001234324
## Cumulative Proportion 0.91469598 0.915932269 0.917166787 0.918401111
## Comp.557 Comp.558 Comp.559 Comp.560
## Standard deviation 0.117171729 0.11711387 0.117071658 0.117055355
## Proportion of Variance 0.001233908 0.00123269 0.001231801 0.001231458
## Cumulative Proportion 0.919635019 0.92086771 0.922099510 0.923330968
## Comp.561 Comp.562 Comp.563 Comp.564
## Standard deviation 0.117002902 0.116916393 0.116873112 0.116794814
## Proportion of Variance 0.001230355 0.001228536 0.001227627 0.001225982
## Cumulative Proportion 0.924561323 0.925789859 0.927017485 0.928243468
## Comp.565 Comp.566 Comp.567 Comp.568
## Standard deviation 0.116770737 0.116715281 0.116644011 0.116532957
## Proportion of Variance 0.001225477 0.001224313 0.001222818 0.001220491
## Cumulative Proportion 0.929468944 0.930693258 0.931916076 0.933136567
## Comp.569 Comp.570 Comp.571 Comp.572
## Standard deviation 0.116531028 0.116442987 0.116400711 0.11633795
## Proportion of Variance 0.001220451 0.001218607 0.001217723 0.00121641
## Cumulative Proportion 0.934357018 0.935575625 0.936793348 0.93800976
## Comp.573 Comp.574 Comp.575 Comp.576
## Standard deviation 0.116323456 0.116267976 0.1162274 0.116130516
## Proportion of Variance 0.001216107 0.001214947 0.0012141 0.001212076
## Cumulative Proportion 0.939225864 0.940440811 0.9416549 0.942866987
## Comp.577 Comp.578 Comp.579 Comp.580
## Standard deviation 0.116085019 0.116028358 0.115979210 0.115971021
## Proportion of Variance 0.001211126 0.001209944 0.001208919 0.001208749
## Cumulative Proportion 0.944078113 0.945288058 0.946496977 0.947705726
## Comp.581 Comp.582 Comp.583 Comp.584
## Standard deviation 0.115885696 0.115844672 0.115795182 0.11568192
## Proportion of Variance 0.001206971 0.001206116 0.001205086 0.00120273
## Cumulative Proportion 0.948912697 0.950118813 0.951323899 0.95252663
## Comp.585 Comp.586 Comp.587 Comp.588
## Standard deviation 0.115649051 0.115536977 0.115461515 0.115385823
## Proportion of Variance 0.001202046 0.001199718 0.001198151 0.001196581
## Cumulative Proportion 0.953728675 0.954928393 0.956126544 0.957323125
## Comp.589 Comp.590 Comp.591 Comp.592
## Standard deviation 0.115236619 0.115159124 0.115156157 0.115090774
## Proportion of Variance 0.001193488 0.001191883 0.001191822 0.001190469
## Cumulative Proportion 0.958516613 0.959708496 0.960900318 0.962090787
## Comp.593 Comp.594 Comp.595 Comp.596
## Standard deviation 0.115072391 0.115038219 0.114943704 0.114573323
## Proportion of Variance 0.001190089 0.001189382 0.001187428 0.001179788
## Cumulative Proportion 0.963280876 0.964470258 0.965657687 0.966837475
## Comp.597 Comp.598 Comp.599 Comp.600
## Standard deviation 0.114555203 0.11442567 0.114317510 0.114254542
## Proportion of Variance 0.001179415 0.00117675 0.001174526 0.001173232
## Cumulative Proportion 0.968016890 0.96919364 0.970368166 0.971541398
## Comp.601 Comp.602 Comp.603 Comp.604
## Standard deviation 0.114137350 0.114072392 0.113923965 0.113836976
## Proportion of Variance 0.001170827 0.001169494 0.001166453 0.001164672
## Cumulative Proportion 0.972712225 0.973881719 0.975048172 0.976212845
## Comp.605 Comp.606 Comp.607 Comp.608
## Standard deviation 0.113807488 0.11370189 0.113550889 0.113504126
## Proportion of Variance 0.001164069 0.00116191 0.001158826 0.001157872
## Cumulative Proportion 0.977376914 0.97853882 0.979697650 0.980855521
## Comp.609 Comp.610 Comp.611 Comp.612
## Standard deviation 0.113397001 0.113364969 0.113274500 0.113117677
## Proportion of Variance 0.001155687 0.001155034 0.001153191 0.001150001
## Cumulative Proportion 0.982011208 0.983166242 0.984319434 0.985469434
## Comp.613 Comp.614 Comp.615 Comp.616
## Standard deviation 0.113038510 0.112628548 0.112454325 0.112406299
## Proportion of Variance 0.001148391 0.001140077 0.001136552 0.001135582
## Cumulative Proportion 0.986617826 0.987757902 0.988894455 0.990030036
## Comp.617 Comp.618 Comp.619 Comp.620
## Standard deviation 0.112321287 0.111584956 0.111484973 0.111203715
## Proportion of Variance 0.001133865 0.001119047 0.001117043 0.001111414
## Cumulative Proportion 0.991163901 0.992282948 0.993399991 0.994511404
## Comp.621 Comp.622 Comp.623 Comp.624
## Standard deviation 0.110762702 0.110688588 0.110409204 0.110390952
## Proportion of Variance 0.001102616 0.001101141 0.001095589 0.001095227
## Cumulative Proportion 0.995614020 0.996715161 0.997810749 0.998905976
## Comp.625
## Standard deviation 0.110330310
## Proportion of Variance 0.001094024
## Cumulative Proportion 1.000000000
The above histogram and table, show components contribution to the variance respectively. None of the components are significant as alone to the variance.
As the components converts pixel values in the original image into the scores of PCA, it is possible to reconstruct the image from the scores. We expect to see higher variance explaining components will reconstruct the image closer to the unprocessed noisy image.
To reconstruct the images, we need to process scores. Scores are firstly normalized, then, turned into matrices. At last, they are displayed by the rasterImage function.
score_1comp <- image_plane_noise_gray_PCA$scores[,1]
score_2comp <- image_plane_noise_gray_PCA$scores[,2]
score_3comp <- image_plane_noise_gray_PCA$scores[,3]
score_1comp <- (score_1comp - min(score_1comp)) / (max(score_1comp)-min(score_1comp))
score_2comp <- (score_2comp - min(score_2comp))/(max(score_2comp)-min(score_2comp))
score_3comp <- (score_3comp - min(score_3comp))/(max(score_3comp)-min(score_3comp))
matrix_score_1comp <- matrix(score_1comp, 232, byrow=TRUE)
matrix_score_2comp <- matrix(score_2comp, 232, byrow=TRUE)
matrix_score_3comp <- matrix(score_3comp, 232, byrow=TRUE)
par(mfrow = c(1,4))
plot(1:232,1:232, ann = TRUE, axes = FALSE, col = 0, main = "Unprocessed")
rasterImage(image_plane_noise_gray,0,0,232,232)
plot(x,y, ann = TRUE, axes = FALSE, col = 0, main = "Reconst. Comp 1")
rasterImage(matrix_score_1comp,0,0,232,232)
plot(x,y, ann = TRUE, axes = FALSE, col = 0, main = " Reconst. Comp 2")
rasterImage(matrix_score_2comp,0,0,232,232)
plot(x,y, ann = TRUE, axes = FALSE, col = 0, main = " Reconst. Comp3")
rasterImage(matrix_score_3comp,0,0,232,232)
A it can be seen above, the reconstruction of component 1 is slightly close to the unprocessed image compared to the others which are only the silhouettes. Please look the barplot of the variences.
Eigenvector Analysis
For the transformation, the eigenvectors give inportant information, Eigenvectors are plotted how they affect the patches.
For this, the eigenvectors are normalized and convert into matrices. Finally they are displayed.
eigen_comp1 <- image_plane_noise_gray_PCA$loadings[,1]
eigen_comp2 <- image_plane_noise_gray_PCA$loadings[,2]
eigen_comp3 <- image_plane_noise_gray_PCA$loadings[,3]
eigen_comp1 <- (eigen_comp1 - min(eigen_comp1))/(max(eigen_comp1)-min(eigen_comp1))
eigen_comp2 <- (eigen_comp2 - min(eigen_comp2))/(max(eigen_comp2)-min(eigen_comp2))
eigen_comp3 <- (eigen_comp3 - min(eigen_comp3))/(max(eigen_comp3)-min(eigen_comp3))
eigen_matrix_1 <- matrix(eigen_comp1,25)
eigen_matrix_2 <- matrix(eigen_comp2,25)
eigen_matrix_3 <- matrix(eigen_comp3,25)
image_plane_noise_gray_PCA$loadings[,1:3]
## Comp.1 Comp.2 Comp.3
## V1 0.02904268 4.261770e-02 2.840594e-02
## V2 0.02972987 4.509996e-02 2.696481e-02
## V3 0.03037982 4.727019e-02 2.452308e-02
## V4 0.03093218 4.970368e-02 2.162254e-02
## V5 0.03141521 5.127737e-02 1.719884e-02
## V6 0.03188993 5.283159e-02 1.272527e-02
## V7 0.03234619 5.373570e-02 7.818289e-03
## V8 0.03283499 5.448125e-02 1.862455e-03
## V9 0.03319305 5.458318e-02 -4.110571e-03
## V10 0.03355509 5.442919e-02 -1.060651e-02
## V11 0.03377960 5.418327e-02 -1.684265e-02
## V12 0.03402375 5.335714e-02 -2.296624e-02
## V13 0.03418382 5.238499e-02 -2.867235e-02
## V14 0.03428597 5.138797e-02 -3.369228e-02
## V15 0.03442923 4.990604e-02 -3.849030e-02
## V16 0.03444169 4.827799e-02 -4.274678e-02
## V17 0.03437252 4.600880e-02 -4.671085e-02
## V18 0.03421527 4.390947e-02 -4.936279e-02
## V19 0.03402202 4.169840e-02 -5.106352e-02
## V20 0.03396032 3.928900e-02 -5.247233e-02
## V21 0.03380890 3.670780e-02 -5.296826e-02
## V22 0.03340414 3.420523e-02 -5.272338e-02
## V23 0.03302985 3.164124e-02 -5.192229e-02
## V24 0.03269566 2.905177e-02 -4.991837e-02
## V25 0.03240015 2.656547e-02 -4.712743e-02
## V26 0.03003560 4.531602e-02 3.074685e-02
## V27 0.03079488 4.800644e-02 2.953268e-02
## V28 0.03154393 5.037482e-02 2.718963e-02
## V29 0.03217507 5.279444e-02 2.430828e-02
## V30 0.03271945 5.445232e-02 1.975169e-02
## V31 0.03325535 5.598494e-02 1.507042e-02
## V32 0.03375669 5.685819e-02 9.885728e-03
## V33 0.03428270 5.749192e-02 3.535671e-03
## V34 0.03465868 5.743306e-02 -2.962034e-03
## V35 0.03505406 5.709277e-02 -9.917190e-03
## V36 0.03527980 5.657833e-02 -1.679763e-02
## V37 0.03551949 5.546397e-02 -2.351190e-02
## V38 0.03568736 5.420270e-02 -2.994380e-02
## V39 0.03578727 5.285899e-02 -3.557689e-02
## V40 0.03591992 5.092589e-02 -4.098731e-02
## V41 0.03589425 4.880856e-02 -4.582285e-02
## V42 0.03577952 4.611398e-02 -5.025682e-02
## V43 0.03559238 4.363170e-02 -5.332387e-02
## V44 0.03535235 4.099128e-02 -5.530127e-02
## V45 0.03523839 3.823989e-02 -5.700424e-02
## V46 0.03502592 3.540775e-02 -5.769581e-02
## V47 0.03454480 3.260175e-02 -5.742523e-02
## V48 0.03411307 2.980906e-02 -5.647380e-02
## V49 0.03368591 2.700333e-02 -5.429243e-02
## V50 0.03332536 2.431421e-02 -5.116579e-02
## V51 0.03114221 4.766269e-02 3.334291e-02
## V52 0.03195778 5.051938e-02 3.225670e-02
## V53 0.03276688 5.297061e-02 3.000901e-02
## V54 0.03345047 5.538339e-02 2.714578e-02
## V55 0.03406616 5.703245e-02 2.244726e-02
## V56 0.03465236 5.850818e-02 1.749601e-02
## V57 0.03520914 5.926468e-02 1.203504e-02
## V58 0.03577270 5.974371e-02 5.365270e-03
## V59 0.03618500 5.944983e-02 -1.629988e-03
## V60 0.03659505 5.883698e-02 -9.081413e-03
## V61 0.03684669 5.794482e-02 -1.649486e-02
## V62 0.03711131 5.642758e-02 -2.377553e-02
## V63 0.03728106 5.477733e-02 -3.064511e-02
## V64 0.03736577 5.296052e-02 -3.682830e-02
## V65 0.03748771 5.053994e-02 -4.283138e-02
## V66 0.03743640 4.799654e-02 -4.808779e-02
## V67 0.03730492 4.489717e-02 -5.279511e-02
## V68 0.03706361 4.206726e-02 -5.618946e-02
## V69 0.03677677 3.909971e-02 -5.845676e-02
## V70 0.03659947 3.598404e-02 -6.024339e-02
## V71 0.03632191 3.285940e-02 -6.105743e-02
## V72 0.03578304 2.976607e-02 -6.079028e-02
## V73 0.03527232 2.685210e-02 -5.966405e-02
## V74 0.03477904 2.389157e-02 -5.725493e-02
## V75 0.03434635 2.104994e-02 -5.398913e-02
## V76 0.03201407 4.942587e-02 3.574264e-02
## V77 0.03288050 5.236654e-02 3.476569e-02
## V78 0.03374195 5.481617e-02 3.260254e-02
## V79 0.03450004 5.714613e-02 2.980086e-02
## V80 0.03519237 5.872253e-02 2.494183e-02
## V81 0.03582571 6.004734e-02 1.983218e-02
## V82 0.03640929 6.062484e-02 1.416798e-02
## V83 0.03702583 6.091939e-02 7.249237e-03
## V84 0.03745877 6.036500e-02 -9.166216e-05
## V85 0.03788511 5.942175e-02 -7.823851e-03
## V86 0.03816035 5.818268e-02 -1.571538e-02
## V87 0.03842013 5.624476e-02 -2.357078e-02
## V88 0.03859564 5.420279e-02 -3.078507e-02
## V89 0.03867349 5.194747e-02 -3.744998e-02
## V90 0.03874637 4.903305e-02 -4.392980e-02
## V91 0.03868000 4.618064e-02 -4.957271e-02
## V92 0.03850322 4.265374e-02 -5.462706e-02
## V93 0.03821950 3.945329e-02 -5.832976e-02
## V94 0.03788777 3.621367e-02 -6.083850e-02
## V95 0.03766886 3.279908e-02 -6.277666e-02
## V96 0.03735137 2.940379e-02 -6.367160e-02
## V97 0.03675658 2.613924e-02 -6.342276e-02
## V98 0.03620082 2.317123e-02 -6.217851e-02
## V99 0.03564256 2.013834e-02 -5.958278e-02
## V100 0.03513097 1.725659e-02 -5.614165e-02
## V101 0.03275141 5.065252e-02 3.768953e-02
## V102 0.03369214 5.361102e-02 3.685589e-02
## V103 0.03461128 5.596358e-02 3.482915e-02
## V104 0.03542463 5.815517e-02 3.209368e-02
## V105 0.03616382 5.956938e-02 2.730067e-02
## V106 0.03685234 6.070312e-02 2.215753e-02
## V107 0.03745384 6.100117e-02 1.638355e-02
## V108 0.03809702 6.098987e-02 9.311855e-03
## V109 0.03855827 6.011333e-02 1.795904e-03
## V110 0.03900135 5.878286e-02 -6.211694e-03
## V111 0.03928514 5.721266e-02 -1.447030e-02
## V112 0.03955250 5.487772e-02 -2.264907e-02
## V113 0.03973236 5.245248e-02 -3.024242e-02
## V114 0.03978430 4.979924e-02 -3.741854e-02
## V115 0.03982647 4.646171e-02 -4.432255e-02
## V116 0.03972782 4.324710e-02 -5.031953e-02
## V117 0.03950962 3.937021e-02 -5.561176e-02
## V118 0.03917684 3.581739e-02 -5.949301e-02
## V119 0.03881011 3.236333e-02 -6.225379e-02
## V120 0.03854538 2.871965e-02 -6.429313e-02
## V121 0.03817017 2.514816e-02 -6.534296e-02
## V122 0.03754423 2.178996e-02 -6.517469e-02
## V123 0.03693982 1.880699e-02 -6.384488e-02
## V124 0.03634199 1.584249e-02 -6.120544e-02
## V125 0.03576965 1.301952e-02 -5.772507e-02
## V126 0.03363411 5.135747e-02 3.959296e-02
## V127 0.03461455 5.419373e-02 3.891034e-02
## V128 0.03558450 5.635577e-02 3.691391e-02
## V129 0.03643178 5.831256e-02 3.416595e-02
## V130 0.03722493 5.945395e-02 2.940857e-02
## V131 0.03794409 6.025526e-02 2.425310e-02
## V132 0.03856584 6.028098e-02 1.843678e-02
## V133 0.03923665 5.989442e-02 1.133897e-02
## V134 0.03969787 5.861519e-02 3.687704e-03
## V135 0.04014457 5.685230e-02 -4.482190e-03
## V136 0.04044994 5.487760e-02 -1.287720e-02
## V137 0.04068289 5.209829e-02 -2.130458e-02
## V138 0.04085810 4.929955e-02 -2.915971e-02
## V139 0.04090064 4.619883e-02 -3.659538e-02
## V140 0.04093806 4.246362e-02 -4.378227e-02
## V141 0.04080241 3.887907e-02 -4.994658e-02
## V142 0.04056588 3.475808e-02 -5.549705e-02
## V143 0.04019693 3.094763e-02 -5.956355e-02
## V144 0.03980321 2.731056e-02 -6.245647e-02
## V145 0.03947583 2.357699e-02 -6.462529e-02
## V146 0.03905808 1.985138e-02 -6.574289e-02
## V147 0.03839723 1.645623e-02 -6.558181e-02
## V148 0.03775327 1.344439e-02 -6.418882e-02
## V149 0.03710145 1.057097e-02 -6.156884e-02
## V150 0.03648708 7.836573e-03 -5.809414e-02
## V151 0.03458771 5.154825e-02 4.114079e-02
## V152 0.03561673 5.410966e-02 4.065481e-02
## V153 0.03660054 5.598562e-02 3.887264e-02
## V154 0.03748752 5.762130e-02 3.625652e-02
## V155 0.03830416 5.839394e-02 3.164827e-02
## V156 0.03905353 5.885697e-02 2.655408e-02
## V157 0.03969007 5.848793e-02 2.074724e-02
## V158 0.04036325 5.760158e-02 1.361225e-02
## V159 0.04083559 5.592228e-02 5.971978e-03
## V160 0.04129358 5.373640e-02 -2.208180e-03
## V161 0.04159232 5.133619e-02 -1.073777e-02
## V162 0.04182625 4.812569e-02 -1.934734e-02
## V163 0.04200183 4.500196e-02 -2.733596e-02
## V164 0.04203480 4.160818e-02 -3.505448e-02
## V165 0.04205819 3.747179e-02 -4.246575e-02
## V166 0.04188991 3.359007e-02 -4.883076e-02
## V167 0.04160749 2.911096e-02 -5.452957e-02
## V168 0.04122098 2.509182e-02 -5.879452e-02
## V169 0.04078470 2.134933e-02 -6.186941e-02
## V170 0.04041502 1.754431e-02 -6.406442e-02
## V171 0.03994917 1.381101e-02 -6.521389e-02
## V172 0.03924229 1.047953e-02 -6.514688e-02
## V173 0.03856184 7.539962e-03 -6.378722e-02
## V174 0.03786756 4.884826e-03 -6.115015e-02
## V175 0.03721520 2.339973e-03 -5.764162e-02
## V176 0.03527496 5.047470e-02 4.243178e-02
## V177 0.03631464 5.266692e-02 4.214378e-02
## V178 0.03729635 5.420547e-02 4.056222e-02
## V179 0.03821339 5.546396e-02 3.810368e-02
## V180 0.03904325 5.587752e-02 3.370263e-02
## V181 0.03980285 5.589251e-02 2.879132e-02
## V182 0.04045142 5.514529e-02 2.305850e-02
## V183 0.04116456 5.382970e-02 1.624279e-02
## V184 0.04164205 5.172534e-02 8.806597e-03
## V185 0.04209944 4.917891e-02 6.261953e-04
## V186 0.04240039 4.635523e-02 -7.805390e-03
## V187 0.04262939 4.280892e-02 -1.653794e-02
## V188 0.04278376 3.934681e-02 -2.461540e-02
## V189 0.04280581 3.567150e-02 -3.236554e-02
## V190 0.04279237 3.128333e-02 -3.993835e-02
## V191 0.04262796 2.719810e-02 -4.643146e-02
## V192 0.04232091 2.261865e-02 -5.237694e-02
## V193 0.04190836 1.848936e-02 -5.677343e-02
## V194 0.04143288 1.467624e-02 -6.005813e-02
## V195 0.04102071 1.086568e-02 -6.248397e-02
## V196 0.04050814 7.102648e-03 -6.366844e-02
## V197 0.03980314 3.832563e-03 -6.379593e-02
## V198 0.03906566 1.029201e-03 -6.254348e-02
## V199 0.03833003 -1.435432e-03 -6.000059e-02
## V200 0.03764434 -3.788861e-03 -5.661807e-02
## V201 0.03578247 4.860865e-02 4.372302e-02
## V202 0.03683349 5.045619e-02 4.372126e-02
## V203 0.03782327 5.157599e-02 4.243931e-02
## V204 0.03875649 5.235435e-02 4.030308e-02
## V205 0.03958302 5.229636e-02 3.623481e-02
## V206 0.04036127 5.191998e-02 3.156895e-02
## V207 0.04102054 5.075377e-02 2.605198e-02
## V208 0.04172779 4.893683e-02 1.947427e-02
## V209 0.04221857 4.647042e-02 1.228576e-02
## V210 0.04268801 4.358572e-02 4.179266e-03
## V211 0.04298663 4.037541e-02 -4.131910e-03
## V212 0.04319274 3.642441e-02 -1.291079e-02
## V213 0.04333066 3.263826e-02 -2.099737e-02
## V214 0.04332801 2.869087e-02 -2.879401e-02
## V215 0.04330223 2.408524e-02 -3.652169e-02
## V216 0.04313804 1.986107e-02 -4.316487e-02
## V217 0.04283044 1.517737e-02 -4.921372e-02
## V218 0.04238671 1.101152e-02 -5.371377e-02
## V219 0.04188861 7.221606e-03 -5.718851e-02
## V220 0.04144318 3.525418e-03 -5.985933e-02
## V221 0.04089390 -1.287186e-04 -6.118757e-02
## V222 0.04017534 -3.252466e-03 -6.155755e-02
## V223 0.03940774 -5.821478e-03 -6.046633e-02
## V224 0.03864760 -7.877389e-03 -5.815429e-02
## V225 0.03792157 -9.853724e-03 -5.490842e-02
## V226 0.03642223 4.612245e-02 4.478381e-02
## V227 0.03744864 4.754932e-02 4.510334e-02
## V228 0.03843935 4.829663e-02 4.410981e-02
## V229 0.03938309 4.864459e-02 4.242025e-02
## V230 0.04021300 4.819398e-02 3.871499e-02
## V231 0.04099802 4.744566e-02 3.440365e-02
## V232 0.04166029 4.592140e-02 2.919295e-02
## V233 0.04237079 4.374076e-02 2.293140e-02
## V234 0.04284653 4.087939e-02 1.591059e-02
## V235 0.04330537 3.766755e-02 7.955567e-03
## V236 0.04361220 3.408511e-02 -2.098101e-04
## V237 0.04380580 2.980396e-02 -9.017772e-03
## V238 0.04394008 2.582673e-02 -1.703648e-02
## V239 0.04392416 2.166333e-02 -2.494083e-02
## V240 0.04388503 1.691466e-02 -3.281238e-02
## V241 0.04370886 1.260220e-02 -3.968365e-02
## V242 0.04335616 7.861043e-03 -4.592066e-02
## V243 0.04291153 3.660039e-03 -5.056052e-02
## V244 0.04239740 -6.268401e-05 -5.427872e-02
## V245 0.04193150 -3.679205e-03 -5.707957e-02
## V246 0.04135905 -7.173772e-03 -5.870166e-02
## V247 0.04062840 -1.004405e-02 -5.930598e-02
## V248 0.03983793 -1.243443e-02 -5.832045e-02
## V249 0.03902103 -1.422836e-02 -5.622780e-02
## V250 0.03826710 -1.592275e-02 -5.311955e-02
## V251 0.03690576 4.247216e-02 4.609482e-02
## V252 0.03791760 4.336639e-02 4.672500e-02
## V253 0.03890753 4.372033e-02 4.614171e-02
## V254 0.03984222 4.363857e-02 4.484653e-02
## V255 0.04066081 4.270444e-02 4.154473e-02
## V256 0.04145801 4.154022e-02 3.758670e-02
## V257 0.04211577 3.968636e-02 3.272219e-02
## V258 0.04283894 3.709336e-02 2.690941e-02
## V259 0.04331497 3.396946e-02 2.028617e-02
## V260 0.04377521 3.046958e-02 1.258184e-02
## V261 0.04408854 2.663521e-02 4.620328e-03
## V262 0.04426233 2.211039e-02 -4.104872e-03
## V263 0.04440975 1.797498e-02 -1.206055e-02
## V264 0.04442014 1.362378e-02 -1.999049e-02
## V265 0.04437714 8.798345e-03 -2.785194e-02
## V266 0.04419237 4.431965e-03 -3.477320e-02
## V267 0.04381096 -2.843484e-04 -4.133306e-02
## V268 0.04334752 -4.447473e-03 -4.613323e-02
## V269 0.04282468 -8.072907e-03 -5.008102e-02
## V270 0.04235050 -1.156774e-02 -5.308718e-02
## V271 0.04175414 -1.486762e-02 -5.496122e-02
## V272 0.04100318 -1.744025e-02 -5.591042e-02
## V273 0.04018415 -1.954598e-02 -5.524863e-02
## V274 0.03936171 -2.103059e-02 -5.352966e-02
## V275 0.03856384 -2.233118e-02 -5.076500e-02
## V276 0.03743114 3.837976e-02 4.744920e-02
## V277 0.03845265 3.884891e-02 4.837734e-02
## V278 0.03944805 3.882143e-02 4.819177e-02
## V279 0.04036798 3.828861e-02 4.731666e-02
## V280 0.04119444 3.697569e-02 4.440155e-02
## V281 0.04200831 3.539617e-02 4.080008e-02
## V282 0.04265392 3.318939e-02 3.640578e-02
## V283 0.04335979 3.023657e-02 3.095678e-02
## V284 0.04383152 2.685821e-02 2.460542e-02
## V285 0.04425983 2.308921e-02 1.711739e-02
## V286 0.04455692 1.897974e-02 9.322380e-03
## V287 0.04473062 1.427360e-02 6.648213e-04
## V288 0.04488169 9.958672e-03 -7.249907e-03
## V289 0.04489337 5.498625e-03 -1.517275e-02
## V290 0.04483320 6.302068e-04 -2.304520e-02
## V291 0.04463072 -3.763055e-03 -2.999549e-02
## V292 0.04423184 -8.352324e-03 -3.675824e-02
## V293 0.04374806 -1.236188e-02 -4.182097e-02
## V294 0.04319495 -1.585143e-02 -4.607730e-02
## V295 0.04269049 -1.910779e-02 -4.927372e-02
## V296 0.04206292 -2.219046e-02 -5.148875e-02
## V297 0.04129673 -2.448729e-02 -5.281906e-02
## V298 0.04045131 -2.628151e-02 -5.244065e-02
## V299 0.03959653 -2.742441e-02 -5.110271e-02
## V300 0.03878188 -2.831179e-02 -4.859243e-02
## V301 0.03777974 3.381325e-02 4.845506e-02
## V302 0.03879742 3.383545e-02 4.974150e-02
## V303 0.03977133 3.344237e-02 4.991371e-02
## V304 0.04067112 3.249453e-02 4.946092e-02
## V305 0.04148300 3.078657e-02 4.692348e-02
## V306 0.04230339 2.884960e-02 4.378414e-02
## V307 0.04293792 2.630320e-02 3.981500e-02
## V308 0.04363072 2.308257e-02 3.473723e-02
## V309 0.04410064 1.945187e-02 2.869493e-02
## V310 0.04453717 1.546263e-02 2.157182e-02
## V311 0.04480922 1.116806e-02 1.408132e-02
## V312 0.04497594 6.285353e-03 5.651700e-03
## V313 0.04512192 1.917513e-03 -2.217961e-03
## V314 0.04511296 -2.563516e-03 -1.006348e-02
## V315 0.04504348 -7.392140e-03 -1.795099e-02
## V316 0.04484427 -1.171146e-02 -2.490728e-02
## V317 0.04443217 -1.613660e-02 -3.177682e-02
## V318 0.04394714 -1.994481e-02 -3.708596e-02
## V319 0.04340036 -2.325172e-02 -4.154342e-02
## V320 0.04287550 -2.620343e-02 -4.508403e-02
## V321 0.04223660 -2.905338e-02 -4.765463e-02
## V322 0.04147567 -3.108780e-02 -4.930190e-02
## V323 0.04060176 -3.257660e-02 -4.934282e-02
## V324 0.03974389 -3.326201e-02 -4.838941e-02
## V325 0.03890150 -3.378157e-02 -4.620285e-02
## V326 0.03804935 2.870783e-02 4.990694e-02
## V327 0.03906216 2.825725e-02 5.146425e-02
## V328 0.03999362 2.740403e-02 5.201871e-02
## V329 0.04088927 2.608500e-02 5.197543e-02
## V330 0.04169939 2.409719e-02 4.979776e-02
## V331 0.04252190 2.191757e-02 4.704345e-02
## V332 0.04314305 1.904431e-02 4.346448e-02
## V333 0.04381490 1.567139e-02 3.872098e-02
## V334 0.04426575 1.184266e-02 3.297692e-02
## V335 0.04467389 7.699615e-03 2.613043e-02
## V336 0.04495941 3.290708e-03 1.885953e-02
## V337 0.04511167 -1.662332e-03 1.063296e-02
## V338 0.04523078 -5.996128e-03 2.818969e-03
## V339 0.04521333 -1.048517e-02 -4.883972e-03
## V340 0.04513868 -1.523772e-02 -1.279329e-02
## V341 0.04493206 -1.940063e-02 -1.982703e-02
## V342 0.04450653 -2.367700e-02 -2.690773e-02
## V343 0.04402609 -2.716905e-02 -3.242372e-02
## V344 0.04346333 -3.027052e-02 -3.714683e-02
## V345 0.04290720 -3.289906e-02 -4.094554e-02
## V346 0.04227792 -3.538089e-02 -4.393417e-02
## V347 0.04150293 -3.706773e-02 -4.585608e-02
## V348 0.04062283 -3.817494e-02 -4.633570e-02
## V349 0.03976040 -3.849907e-02 -4.578271e-02
## V350 0.03887960 -3.856153e-02 -4.395754e-02
## V351 0.03830943 2.300751e-02 5.141497e-02
## V352 0.03930029 2.215631e-02 5.319334e-02
## V353 0.04020162 2.096290e-02 5.405793e-02
## V354 0.04109013 1.928027e-02 5.433102e-02
## V355 0.04189474 1.701439e-02 5.251679e-02
## V356 0.04270416 1.460100e-02 5.014153e-02
## V357 0.04331612 1.149732e-02 4.682628e-02
## V358 0.04395348 7.955725e-03 4.247705e-02
## V359 0.04438390 4.051748e-03 3.713256e-02
## V360 0.04478289 -2.450532e-04 3.061186e-02
## V361 0.04506366 -4.627139e-03 2.359666e-02
## V362 0.04518516 -9.552282e-03 1.555582e-02
## V363 0.04529126 -1.387499e-02 7.902678e-03
## V364 0.04528093 -1.824916e-02 2.388561e-04
## V365 0.04518902 -2.282588e-02 -7.600464e-03
## V366 0.04496745 -2.681901e-02 -1.459381e-02
## V367 0.04454517 -3.079921e-02 -2.178348e-02
## V368 0.04406135 -3.408027e-02 -2.749209e-02
## V369 0.04349983 -3.691674e-02 -3.248027e-02
## V370 0.04294462 -3.927131e-02 -3.671682e-02
## V371 0.04230148 -4.135478e-02 -4.005585e-02
## V372 0.04151499 -4.270985e-02 -4.235391e-02
## V373 0.04062433 -4.341718e-02 -4.323175e-02
## V374 0.03976251 -4.334557e-02 -4.315519e-02
## V375 0.03885038 -4.297008e-02 -4.173626e-02
## V376 0.03848659 1.716830e-02 5.290019e-02
## V377 0.03947667 1.589595e-02 5.495484e-02
## V378 0.04036921 1.438721e-02 5.617328e-02
## V379 0.04122711 1.236515e-02 5.680582e-02
## V380 0.04202016 9.820878e-03 5.534337e-02
## V381 0.04281802 7.218494e-03 5.326662e-02
## V382 0.04342123 3.959472e-03 5.018898e-02
## V383 0.04401926 3.144759e-04 4.610386e-02
## V384 0.04446253 -3.576259e-03 4.111498e-02
## V385 0.04485360 -7.925346e-03 3.495054e-02
## V386 0.04511152 -1.228867e-02 2.817110e-02
## V387 0.04521863 -1.710149e-02 2.030300e-02
## V388 0.04533078 -2.130531e-02 1.275301e-02
## V389 0.04532236 -2.557846e-02 5.151330e-03
## V390 0.04523245 -2.996709e-02 -2.626835e-03
## V391 0.04499171 -3.376344e-02 -9.665108e-03
## V392 0.04456290 -3.743536e-02 -1.699756e-02
## V393 0.04405340 -4.047171e-02 -2.296249e-02
## V394 0.04348948 -4.298732e-02 -2.831387e-02
## V395 0.04290624 -4.504632e-02 -3.285729e-02
## V396 0.04226516 -4.676603e-02 -3.656797e-02
## V397 0.04146486 -4.771295e-02 -3.931040e-02
## V398 0.04058016 -4.805660e-02 -4.057558e-02
## V399 0.03969878 -4.764602e-02 -4.085443e-02
## V400 0.03878259 -4.682300e-02 -3.982865e-02
## V401 0.03846109 1.126506e-02 5.410800e-02
## V402 0.03941978 9.616889e-03 5.635186e-02
## V403 0.04028624 7.911576e-03 5.779958e-02
## V404 0.04111457 5.671299e-03 5.855155e-02
## V405 0.04191201 2.902553e-03 5.736858e-02
## V406 0.04269078 1.226439e-04 5.567914e-02
## V407 0.04327548 -3.259758e-03 5.291681e-02
## V408 0.04386030 -6.911249e-03 4.915462e-02
## V409 0.04427992 -1.078875e-02 4.438987e-02
## V410 0.04465038 -1.514121e-02 3.848273e-02
## V411 0.04488862 -1.941821e-02 3.199195e-02
## V412 0.04496404 -2.407240e-02 2.435684e-02
## V413 0.04506959 -2.806366e-02 1.693869e-02
## V414 0.04502853 -3.219435e-02 9.441591e-03
## V415 0.04489968 -3.629589e-02 1.733357e-03
## V416 0.04465473 -3.978249e-02 -5.352135e-03
## V417 0.04420203 -4.318437e-02 -1.267971e-02
## V418 0.04367602 -4.584902e-02 -1.885375e-02
## V419 0.04312141 -4.806749e-02 -2.442468e-02
## V420 0.04254662 -4.980761e-02 -2.912843e-02
## V421 0.04189123 -5.108664e-02 -3.319058e-02
## V422 0.04109508 -5.167772e-02 -3.620908e-02
## V423 0.04023036 -5.163189e-02 -3.780708e-02
## V424 0.03935534 -5.090943e-02 -3.838514e-02
## V425 0.03840999 -4.970826e-02 -3.774316e-02
## V426 0.03834884 5.425719e-03 5.509543e-02
## V427 0.03929207 3.411076e-03 5.753096e-02
## V428 0.04014708 1.358253e-03 5.917800e-02
## V429 0.04094438 -1.046968e-03 6.015231e-02
## V430 0.04172105 -3.914003e-03 5.927510e-02
## V431 0.04247692 -6.814757e-03 5.779165e-02
## V432 0.04303503 -1.034970e-02 5.533417e-02
## V433 0.04359904 -1.404837e-02 5.181043e-02
## V434 0.04399557 -1.786579e-02 4.718552e-02
## V435 0.04435689 -2.213092e-02 4.151046e-02
## V436 0.04458690 -2.629130e-02 3.535708e-02
## V437 0.04463835 -3.070291e-02 2.798725e-02
## V438 0.04473501 -3.445130e-02 2.068711e-02
## V439 0.04466970 -3.835485e-02 1.331589e-02
## V440 0.04451007 -4.208042e-02 5.753235e-03
## V441 0.04424138 -4.534637e-02 -1.404189e-03
## V442 0.04380857 -4.838020e-02 -8.761693e-03
## V443 0.04325475 -5.069492e-02 -1.516863e-02
## V444 0.04269685 -5.256543e-02 -2.088044e-02
## V445 0.04211278 -5.390959e-02 -2.578433e-02
## V446 0.04145372 -5.473161e-02 -3.009445e-02
## V447 0.04065268 -5.495147e-02 -3.335967e-02
## V448 0.03978032 -5.451480e-02 -3.534625e-02
## V449 0.03891721 -5.345784e-02 -3.616288e-02
## V450 0.03796906 -5.191031e-02 -3.584240e-02
## V451 0.03826961 -3.421543e-04 5.575392e-02
## V452 0.03918155 -2.599241e-03 5.819377e-02
## V453 0.04000294 -4.837372e-03 5.991829e-02
## V454 0.04075896 -7.418525e-03 6.091595e-02
## V455 0.04153575 -1.038256e-02 6.030938e-02
## V456 0.04225334 -1.337371e-02 5.891417e-02
## V457 0.04276822 -1.692731e-02 5.667009e-02
## V458 0.04328153 -2.061389e-02 5.335971e-02
## V459 0.04364852 -2.429467e-02 4.904635e-02
## V460 0.04398016 -2.846470e-02 4.362828e-02
## V461 0.04418430 -3.245544e-02 3.773247e-02
## V462 0.04419113 -3.664834e-02 3.065919e-02
## V463 0.04425896 -4.013071e-02 2.351006e-02
## V464 0.04416260 -4.377375e-02 1.631721e-02
## V465 0.04397742 -4.715733e-02 8.957813e-03
## V466 0.04370111 -4.998973e-02 1.831486e-03
## V467 0.04326217 -5.263123e-02 -5.401177e-03
## V468 0.04270705 -5.450481e-02 -1.192708e-02
## V469 0.04217308 -5.598049e-02 -1.775382e-02
## V470 0.04157546 -5.695693e-02 -2.264387e-02
## V471 0.04091401 -5.732408e-02 -2.713229e-02
## V472 0.04011869 -5.721164e-02 -3.055251e-02
## V473 0.03924674 -5.639683e-02 -3.272833e-02
## V474 0.03839581 -5.504920e-02 -3.372862e-02
## V475 0.03747471 -5.314016e-02 -3.369209e-02
## V476 0.03815817 -5.829395e-03 5.592298e-02
## V477 0.03904920 -8.250844e-03 5.842826e-02
## V478 0.03982596 -1.069010e-02 6.014794e-02
## V479 0.04054603 -1.333070e-02 6.121580e-02
## V480 0.04127766 -1.635627e-02 6.085026e-02
## V481 0.04196566 -1.939139e-02 5.952146e-02
## V482 0.04244619 -2.283937e-02 5.734880e-02
## V483 0.04290800 -2.643639e-02 5.424121e-02
## V484 0.04323941 -2.994582e-02 5.016299e-02
## V485 0.04353966 -3.390187e-02 4.502339e-02
## V486 0.04369085 -3.760585e-02 3.937684e-02
## V487 0.04368534 -4.143224e-02 3.257160e-02
## V488 0.04373476 -4.463946e-02 2.569254e-02
## V489 0.04363517 -4.797083e-02 1.865080e-02
## V490 0.04342309 -5.086668e-02 1.147032e-02
## V491 0.04311297 -5.334562e-02 4.434193e-03
## V492 0.04266313 -5.563016e-02 -2.697567e-03
## V493 0.04211915 -5.713781e-02 -9.131312e-03
## V494 0.04157842 -5.818026e-02 -1.495745e-02
## V495 0.04097466 -5.876674e-02 -1.989568e-02
## V496 0.04031657 -5.881666e-02 -2.446056e-02
## V497 0.03953502 -5.835759e-02 -2.792362e-02
## V498 0.03867562 -5.723355e-02 -3.027041e-02
## V499 0.03784759 -5.553582e-02 -3.149893e-02
## V500 0.03695030 -5.331763e-02 -3.173705e-02
## V501 0.03783685 -1.100128e-02 5.551862e-02
## V502 0.03867317 -1.354315e-02 5.803530e-02
## V503 0.03941279 -1.608174e-02 5.977798e-02
## V504 0.04009756 -1.868861e-02 6.087569e-02
## V505 0.04076674 -2.165873e-02 6.057449e-02
## V506 0.04142121 -2.461266e-02 5.936610e-02
## V507 0.04185450 -2.793944e-02 5.724683e-02
## V508 0.04228028 -3.131119e-02 5.435173e-02
## V509 0.04257588 -3.455702e-02 5.046216e-02
## V510 0.04283344 -3.829900e-02 4.557272e-02
## V511 0.04294895 -4.165355e-02 4.019486e-02
## V512 0.04290839 -4.509054e-02 3.369235e-02
## V513 0.04295093 -4.788793e-02 2.710072e-02
## V514 0.04280904 -5.092986e-02 2.035227e-02
## V515 0.04257415 -5.337932e-02 1.342598e-02
## V516 0.04226500 -5.547073e-02 6.574251e-03
## V517 0.04178757 -5.732680e-02 -4.442497e-04
## V518 0.04124248 -5.842645e-02 -6.750048e-03
## V519 0.04071872 -5.912735e-02 -1.244989e-02
## V520 0.04010456 -5.944044e-02 -1.739703e-02
## V521 0.03945884 -5.910504e-02 -2.191491e-02
## V522 0.03871020 -5.838318e-02 -2.544520e-02
## V523 0.03787981 -5.695069e-02 -2.784916e-02
## V524 0.03709705 -5.507949e-02 -2.908730e-02
## V525 0.03624583 -5.276503e-02 -2.952382e-02
## V526 0.03748203 -1.542851e-02 5.403739e-02
## V527 0.03826384 -1.808384e-02 5.651066e-02
## V528 0.03896546 -2.065979e-02 5.824119e-02
## V529 0.03957558 -2.325380e-02 5.935447e-02
## V530 0.04019526 -2.608907e-02 5.910487e-02
## V531 0.04079232 -2.896469e-02 5.809282e-02
## V532 0.04118016 -3.207280e-02 5.616910e-02
## V533 0.04156204 -3.521075e-02 5.345867e-02
## V534 0.04181286 -3.812715e-02 4.973705e-02
## V535 0.04202850 -4.155937e-02 4.511859e-02
## V536 0.04210241 -4.461674e-02 4.005633e-02
## V537 0.04203559 -4.768419e-02 3.396076e-02
## V538 0.04205208 -5.008228e-02 2.781284e-02
## V539 0.04187295 -5.280034e-02 2.140802e-02
## V540 0.04162109 -5.489041e-02 1.481845e-02
## V541 0.04128401 -5.663086e-02 8.256410e-03
## V542 0.04081567 -5.808750e-02 1.508821e-03
## V543 0.04025138 -5.881883e-02 -4.712703e-03
## V544 0.03973592 -5.921593e-02 -1.021113e-02
## V545 0.03913309 -5.922900e-02 -1.502982e-02
## V546 0.03849433 -5.868210e-02 -1.949806e-02
## V547 0.03776810 -5.771093e-02 -2.300650e-02
## V548 0.03697893 -5.606319e-02 -2.545158e-02
## V549 0.03623595 -5.409331e-02 -2.678265e-02
## V550 0.03543872 -5.172943e-02 -2.731588e-02
## V551 0.03704713 -1.914277e-02 5.186687e-02
## V552 0.03776482 -2.180519e-02 5.421532e-02
## V553 0.03842215 -2.434806e-02 5.591794e-02
## V554 0.03897768 -2.687233e-02 5.695550e-02
## V555 0.03955537 -2.954415e-02 5.673980e-02
## V556 0.04011884 -3.221470e-02 5.586502e-02
## V557 0.04045043 -3.507843e-02 5.400690e-02
## V558 0.04078110 -3.791943e-02 5.149753e-02
## V559 0.04099668 -4.047410e-02 4.809561e-02
## V560 0.04115162 -4.357572e-02 4.382653e-02
## V561 0.04118965 -4.628594e-02 3.925270e-02
## V562 0.04106636 -4.891287e-02 3.362908e-02
## V563 0.04106138 -5.091790e-02 2.795712e-02
## V564 0.04086496 -5.323327e-02 2.193487e-02
## V565 0.04061867 -5.485914e-02 1.585790e-02
## V566 0.04028945 -5.628264e-02 9.688966e-03
## V567 0.03981561 -5.744268e-02 3.274650e-03
## V568 0.03927285 -5.789273e-02 -2.580121e-03
## V569 0.03878351 -5.810121e-02 -7.919913e-03
## V570 0.03822504 -5.790337e-02 -1.251411e-02
## V571 0.03761090 -5.722826e-02 -1.685589e-02
## V572 0.03692946 -5.615305e-02 -2.028802e-02
## V573 0.03620109 -5.438742e-02 -2.283772e-02
## V574 0.03549562 -5.242069e-02 -2.426762e-02
## V575 0.03474265 -5.012590e-02 -2.495190e-02
## V576 0.03669450 -2.255185e-02 4.905929e-02
## V577 0.03734134 -2.513727e-02 5.122647e-02
## V578 0.03794229 -2.754013e-02 5.273260e-02
## V579 0.03841033 -2.994522e-02 5.365861e-02
## V580 0.03890552 -3.235424e-02 5.351002e-02
## V581 0.03941150 -3.484249e-02 5.285896e-02
## V582 0.03966507 -3.740020e-02 5.115686e-02
## V583 0.03994815 -3.992744e-02 4.896663e-02
## V584 0.04011540 -4.213358e-02 4.596660e-02
## V585 0.04023203 -4.488716e-02 4.209830e-02
## V586 0.04023748 -4.712221e-02 3.802781e-02
## V587 0.04008994 -4.931723e-02 3.305902e-02
## V588 0.04008258 -5.090608e-02 2.797781e-02
## V589 0.03986870 -5.278262e-02 2.237407e-02
## V590 0.03962916 -5.396369e-02 1.691227e-02
## V591 0.03931379 -5.501805e-02 1.118159e-02
## V592 0.03884375 -5.589804e-02 5.160436e-03
## V593 0.03831473 -5.612504e-02 -2.734121e-04
## V594 0.03785213 -5.610422e-02 -5.334856e-03
## V595 0.03731162 -5.574342e-02 -9.718330e-03
## V596 0.03675690 -5.500915e-02 -1.381648e-02
## V597 0.03612302 -5.390760e-02 -1.711672e-02
## V598 0.03544140 -5.208959e-02 -1.979939e-02
## V599 0.03479047 -5.014645e-02 -2.140058e-02
## V600 0.03408342 -4.800313e-02 -2.223760e-02
## V601 0.03602191 -2.509035e-02 4.566008e-02
## V602 0.03658826 -2.749904e-02 4.765232e-02
## V603 0.03713057 -2.969826e-02 4.906954e-02
## V604 0.03754531 -3.182304e-02 4.996929e-02
## V605 0.03797016 -3.393971e-02 4.981761e-02
## V606 0.03843654 -3.622097e-02 4.932337e-02
## V607 0.03863926 -3.847801e-02 4.787223e-02
## V608 0.03887528 -4.053273e-02 4.598462e-02
## V609 0.03902424 -4.236439e-02 4.344353e-02
## V610 0.03910773 -4.477376e-02 4.006879e-02
## V611 0.03908338 -4.662635e-02 3.654121e-02
## V612 0.03891693 -4.841580e-02 3.213076e-02
## V613 0.03892134 -4.966559e-02 2.760142e-02
## V614 0.03869130 -5.123985e-02 2.255102e-02
## V615 0.03845639 -5.215519e-02 1.756306e-02
## V616 0.03816184 -5.292127e-02 1.231563e-02
## V617 0.03772393 -5.360463e-02 6.743542e-03
## V618 0.03721107 -5.367429e-02 1.760738e-03
## V619 0.03676649 -5.350668e-02 -2.990604e-03
## V620 0.03626011 -5.301675e-02 -7.143681e-03
## V621 0.03573300 -5.225609e-02 -1.099379e-02
## V622 0.03514289 -5.112592e-02 -1.421252e-02
## V623 0.03454458 -4.921269e-02 -1.690872e-02
## V624 0.03396976 -4.741736e-02 -1.854459e-02
## V625 0.03332419 -4.547791e-02 -1.958560e-02
grey_Palette <- colorRampPalette(c("black","grey"))
par(mfrow=c(1,3))
image(eigen_matrix_1, col = grey_Palette(256), ann = TRUE, axes = FALSE, main = "Eigenvector 1")
image(eigen_matrix_2, col = grey_Palette(256), ann = TRUE, axes = FALSE, main = "Eigenvector 2")
image(eigen_matrix_3, col = grey_Palette(256), ann = TRUE, axes = FALSE, main = "Eigenvector 3")
In this project, the MUSK data is studied in Task 1, and image (plane) data in Task 2. I mainly used PCA, and MDS analysis are used in TASK 1. No significant relationship is found between the feature vector and the results.
In TASK 2, for the image (plane) processing, PCA Analysisi is used. The image is sucessfully loaded. Worked on it and reconstructed as asked.
Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.